Python file handling

Python file handling

Assessment

Quiz

Created by

Kevin Johnson

Computers

8th - 11th Grade

203 plays

Medium

Student preview

quiz-placeholder

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the last action that must be performed on a file?
Close
Save
End
Write

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the data type of data read to and from a file?

String

Integer

Real

Boolean

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Reading from a file often involves using...

A loop

A condition

Comments

A print() statement

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Appending to a file means adding extra data into the file.
True
False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does this code do?

opens a text file, reads the contents and prints to the screen

opens a text file and writes the variable 'record' to the file

opens a text file and prints 'record' to the screen

opens a text file and prints it out

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What escape character is used to make a new line?

\t

\r

\n

\newline

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the correct Python code to get the number of items in a list named 'scores'

len(scores)

length(scores)

scores.len()

10

Explore all questions with a free account

or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?