Font size
WorksheetsPython Files
Total questions: 15
Worksheet time: 12mins
what is the sysntax of open() function in python
(a)
how many modes for opening a file?
(a)
By default the file is opened in text mode, but you can also open the file in binary mode. Which one of the following syntaxes opens the file in binary mode?
x = bopen('demofile.txt')
x = open('demofile.txt', 'b')
x = open(b'demofile.txt')
what is the use of readline() method?
(a)
The default opening mode when opening a file with the open() function is 'r' for 'reading'.
True
False
After opening a file with the open() function, which method can be used to read the content?
list()
read()
tuple()
"w" - Write - will overwrite any existing content?
True
False
In append mode cursor position will be at?
starting
ending
middle
none
To remove a file you can import the os module, but which function removes the file?
os.delete()
os.drop()
os.remove()
Which os function can be used to delete an entire folder?
os.delete()
os.drop()
os.remove()
what are oops concepts?
(a)
what is the use of init() method in python?
(a)
what is use of self in python?
(a)
what is dictionary in python?
(a)
what is difference between discard() and remove() use in sets?
(a)
