File Handling

File Handling

12th Grade

10 Qs

quiz-placeholder

Similar activities

Teknologi Layanan Jaringan XII

Teknologi Layanan Jaringan XII

12th Grade

10 Qs

Google Aptitude Test

Google Aptitude Test

KG - University

10 Qs

Linux: Users and Groups

Linux: Users and Groups

9th Grade - University

14 Qs

CALL: TOEFL Exercise skill 1-3

CALL: TOEFL Exercise skill 1-3

12th Grade

10 Qs

tik kelas 7

tik kelas 7

1st Grade - University

15 Qs

Dasar Desain Grafis

Dasar Desain Grafis

12th Grade - University

15 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

Review I-PM Ujikom Multimedia

Review I-PM Ujikom Multimedia

12th Grade

10 Qs

File Handling

File Handling

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Gunachitra thiayagarajan

Used 192+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Select the statement to open a file named MYDATA.dat in read binary mode. Let the file object name be myfile.

myfile=open("MYDATA.dat","rb")

myfile=open("MYDATA.dat","r+")

myfile=open("MYDATA.dat","r")

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Mode in the following program to open file for writing in a mode where new data will be added at the end of old data

file =open("poem.txt","__")

r

w

a

r+

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct statement to close a file stream named myfile:

myfile.terminate()

myfile.end()

myfile.close()

myfile.remove()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the ouput -

f=open('abc.txt','w')

x=f.read()

f.close()

print(x)

Error(not readable)

Error(not writable)

It will read all the data of the file.

none

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output-

f=open('abc.txt','a')

text="xyz"

f.write(text)

f.close()

Writing into the file without erasing old content

Writing into the file by erasing old content

reading from the file without erasing old content

reading from the file by erasing old content

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to write multiple lines in text file?

write()

writelines()

lines()

print()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement(s) is/are true to open a binary file "Record.dat" for reading and writing ?

file =open("Record.dat","wb")

file =open("Record.dat","rb")

file =open("Record.dat","ab")

file =open("Record.dat","rb+")

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?