Week 5 Quiz

Week 5 Quiz

University

20 Qs

quiz-placeholder

Similar activities

linux commands

linux commands

University

20 Qs

CSE493_QUIZ 1

CSE493_QUIZ 1

University

20 Qs

Java Array

Java Array

University

23 Qs

TOOLS ADOBE PHOTOSHOP

TOOLS ADOBE PHOTOSHOP

University

15 Qs

Lập trình trực quan

Lập trình trực quan

University

15 Qs

CIS30A Quiz 2 Review Game

CIS30A Quiz 2 Review Game

University

15 Qs

Hadoop

Hadoop

University

15 Qs

Quiz Inf (Sistem Komputer dan Perangkat) Kelas VIII

Quiz Inf (Sistem Komputer dan Perangkat) Kelas VIII

8th Grade - University

20 Qs

Week 5 Quiz

Week 5 Quiz

Assessment

Quiz

Computers

University

Medium

Created by

Anthony G

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to open the file file_in.txt for reading?

open('file_in.txt', 'r')

open('file_in.txt','r+')

open('file_in.txt','w')

open('file_in.txt','a')

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the best way to read an entire file into a list of strings?

.read()

.readline()

.readlines()

.read(all)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the best way to read the first line of a file?

.read()

.readline()

.readlines()

.read(all)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When reading text files, what are the hidden characters typically at the end of each line?

\n

#

@

»

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of following Program in python3

if(32%2==0):

print("32")

else:

print("2")

2

32

error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these pieces of code would return the name "Harry" from the following list?

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

nameList()

nameList[1]

NameList(4)

nameList["4"]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What sort of bracket is for lists?

(

<

}

[

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?