Python Basic files

Python Basic files

10th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Python File Handling

Python File Handling

12th Grade

15 Qs

Binary files in Python

Binary files in Python

12th Grade

13 Qs

File Handling-1

File Handling-1

12th Grade

10 Qs

file handling

file handling

12th Grade

12 Qs

File Handling in Python

File Handling in Python

12th Grade

15 Qs

CUET Level - II Computer Science(7/11/2023)

CUET Level - II Computer Science(7/11/2023)

12th Grade

15 Qs

Python Text Files

Python Text Files

10th - 11th Grade

14 Qs

Python Final Assessment

Python Final Assessment

4th - 12th Grade

10 Qs

Python Basic files

Python Basic files

Assessment

Quiz

Computers

10th - 12th Grade

Medium

Created by

James Abela

Used 216+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

This command will open MyFile = open("MyText.txt")

To read the file

To append to the file

To write to the file

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If I want to add to the end of a text file, I should:

MyCipher = open("MyCipher.txt", "w")

MyCipher = open("MyCipher.txt", "a")

MyCipher = open("MyCipher.txt", "w+")

MyCipher = open("MyCipher.txt", "s")

3.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

Which of these will generate an error?

MyCipher.write("writing")

MyCipher..write(writing)

MyCipher.write("writing",writing)

MyCipher.readline()

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you close the file?

MyFile = close()

MyFile.close

close = MyFile()

MyFile.close()

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Why is it best to open a file with with in Python?

It automatically closes the file

Easier to read the code

Better for binary files

Closers to the pseudocode

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which is the best type of loop to write a file in?

While loop

for loop

repeat loop

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What command can you use to separate parts of a line?

separate()

split()

divide()

cut()

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?