Search Header Logo

File Handling in Python

Authored by indirajith G

Computers

12th Grade

Used 4+ times

File Handling in Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is file handling in Python?

Process of working with files in Python

Method of creating files in Python

Process of deleting files in Python

Technique of renaming files in Python

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to open a file for reading in Python?

load

read

start

open

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default mode of opening a file in Python?

a

r

w

x

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which mode is used to open a file for writing in Python?

x

r

w

a

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which mode is used to open a file for appending in Python?

a

x

w

r

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to read the contents of a file in Python?

open

close

write

read

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? file = open('data.txt', 'r') print(file.read()) file.close()

The file 'data.txt' does not exist.

The contents of the 'data.txt' file will be printed.

An error will occur because the file is not opened in read mode.

The code will print the file object instead of its contents.

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?