Search Header Logo

Python quiz 1

Authored by Saritha B

Computers

Professional Development

Python quiz 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1.What happens if you open an existing file in 'x' mode?

Opens the file normally

Deletes the file

Raises FileExistsError

Overwrites the file

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2.Which file operation mode allows both reading and writing without overwriting?

'r+'

'w+'

'a+'

'x+'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3.What is the result of file.seek(0)?

Moves pointer to end

Moves pointer to start

Closes file

Deletes content

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4.What is the output of len(file.read())?

Number of words

Number of characters

Number of lines

File size in MB

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5.What does the expression file.read().split() do?

Splits file into multiple files

Splits file content into list of words

Splits into lines

Creates new lines

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?