MCQGeeks
0 : 0 : 1
CBSE
JEE
NTSE
NEET
English
UK Quiz
Quiz
Driving Test
Practice
Games
Quiz
Python
Python Certification
Quiz 1
1
2
3
4
5
6
7
8
Q.1
Which are the two built-in functions to read a line of text from standard input, which by default comes from the keyboard?
a) Raw_input & Input
b) Input & Scan
c) Scan & Scanner
d) Scanner
Q.2
Which one of the following is not attributes of file?
a) closed
b) softspace
c) rename
d) mode
Q.3
What is the use of tell() method in python?
a) tells you the current position within the file
b) tells you the end position within the file
c) tells you the file is opened or not
d) none of the mentioned
Q.4
What is the current syntax of rename() a file?
a) rename(current_file_name, new_file_name)
b) rename(new_file_name, current_file_name,)
c) rename(()(current_file_name, new_file_name))
d) none of the mentioned
Q.5
What is the current syntax of remove() a file?
a) remove(file_name)
b) remove(new_file_name, current_file_name,)
c) remove(() , file_name))
d) none of the mentioned
Q.6
What will be the output of the following Python code? fo = open("foo.txt", "rw+")print "Name of the file: ", fo.name # Assuming file has following 5 lines# This is 1st line# This is 2nd line# This is 3rd line# This is 4th line# This is 5th line for index in range(5): line = fo.next() print "Line No %d - %s" % (index, line) # Close opened filefo.close()
a) Compilation Error
b) Syntax Error
c) Displays Output
d) None of the mentioned
Q.7
What is the use of seek() method in files?
a) sets the file’s current position at the offset
b) sets the file’s previous position at the offset
c) sets the file’s current position within the file
d) none of the mentioned
Q.8
What is the use of truncate() method in file?
a) truncates the file size
b) deletes the content of the file
c) deletes the file size
d) none of the mentioned
0 h : 0 m : 1 s
1
2
3
4
5
6
7
8
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqgeeks.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page