gs gs109 Python Files - Python Files - Quiz No.3
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Files. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: Which is/are the basic I/O connections in file?
Standard Input
Standard Output
Standard Errors
All of the mentioned
Question 2: What will be the output of the following Python code? (If entered name is nvaeducation)
import sys print 'Enter your name: ', name = '' while True: c = sys.stdin.read(1) if c == '\n': break name = name + c print 'Your name is:', name
nvaeducation
nvaeducation, nvaeducation
San
None of the mentioned
Question 3: What will be the output of the following Python code?
import sys sys.stdout.write(' Hello\n') sys.stdout.write('Python\n')
Compilation Error
Runtime Error
Hello Python
Hello Python
Question 5: What is the pickling?
It is used for object serialization
It is used for object deserialization
None of the mentioned
All of the mentioned
Question 6: What is unpickling?
It is used for object serialization
It is used for object deserialization
None of the mentioned
All of the mentioned
Question 7: What is the correct syntax of open() function?
file = open(file_name [, access_mode][, buffering])
file object = open(file_name [, access_mode][, buffering])
file object = open(file_name)
none of the mentioned
Question 8: What will be the output of the following Python code?
fo = open("foo.txt", "wb") print "Name of the file: ", fo.name fo.flush() fo.close()
Compilation Error
Runtime Error
No Output
Flushes the file when closing them
Question 9: Correct syntax of file.writelines() is?
file.writelines(sequence)
fileObject.writelines()
fileObject.writelines(sequence)
none of the mentioned
Question 10: Correct syntax of file.readlines() is?
fileObject.readlines( sizehint );
fileObject.readlines();
fileObject.readlines(sequence)
none of the mentioned