python file handling

python file handling

Professional Development

10 Qs

quiz-placeholder

Similar activities

Ms Project - Pretest

Ms Project - Pretest

Professional Development

10 Qs

Google Classroom

Google Classroom

Professional Development

13 Qs

Vaktermen Farmacologie (hoofdstuk 1 en 2)

Vaktermen Farmacologie (hoofdstuk 1 en 2)

Professional Development

11 Qs

TALLY PRIME 4.0 QUIZ

TALLY PRIME 4.0 QUIZ

Professional Development

12 Qs

Linux-Ubuntu chart 1

Linux-Ubuntu chart 1

Professional Development

11 Qs

Quiz 2 Internship on Fundamentals of Python

Quiz 2 Internship on Fundamentals of Python

Professional Development

15 Qs

Pre-Test Pelatihan BIM - Revit Structure

Pre-Test Pelatihan BIM - Revit Structure

Professional Development

11 Qs

MocK Test

MocK Test

Professional Development

10 Qs

python file handling

python file handling

Assessment

Quiz

Professional Development

Professional Development

Medium

Created by

Assistant Chennai

Used 633+ times

FREE Resource

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+")

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?