Podcast
Questions and Answers
which one of the following is the right way to close a file?
which one of the following is the right way to close a file?
- file.close() (correct)
- close(file)
- close("file")
- file.closed
if a file File.txt has 10 lines written in it, what will be the result of the following line?
len(open("File.txt").readlines())
if a file File.txt has 10 lines written in it, what will be the result of the following line? len(open("File.txt").readlines())
- 0
- 1
- 5
- 10 (correct)
a file is stored in ____ memory
a file is stored in ____ memory
- primary
- cache
- volatile
- secondary (correct)
what will happen when a file is opened in write mode and then immediately closed?
what will happen when a file is opened in write mode and then immediately closed?
which one of the following is the right way to write "Good Morning" in a file?
which one of the following is the right way to write "Good Morning" in a file?
which method is used to read a single line from the file?
which method is used to read a single line from the file?
the default access mode is _______
the default access mode is _______
by default, a new file is created in which directory?
by default, a new file is created in which directory?
what is the purpose of the with statement in python file handling?
what is the purpose of the with statement in python file handling?
what is the purpose of the see() method in python file handling?
what is the purpose of the see() method in python file handling?