Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer

From 151 to 165 of 820

Q. What is the pickling?

a. it is used for object serialization

b. it is used for object deserialization

c. none of the mentioned

d. all of the mentioned

  • a. it is used for object serialization

Q. What is unpickling?

a. it is used for object serialization

b. it is used for object deserialization

c. none of the mentioned

d. all of the mentioned

  • b. it is used for object deserialization

Q. What is the correct syntax of open() function?

a. file = open(file_name [, access_mode][, buffering])

b. file object = open(file_name [, access_mode][, buffering])

c. file object = open(file_name)

d. none of the mentioned

  • b. file object = open(file_name [, access_mode][, buffering])

Q. fo.close()

a. compilation error

b. runtime error

c. no output

d. flushes the file when closing them

  • d. flushes the file when closing them

Q. Correct syntax of file.writelines() is?

a. file.writelines(sequence)

b. fileobject.writelines()

c. fileobject.writelines(sequence)

d. none of the mentioned

  • c. fileobject.writelines(sequence)

Q. Correct syntax of file.readlines() is?

a. fileobject.readlines( sizehint );

b. fileobject.readlines();

c. fileobject.readlines(sequence)

d. none of the mentioned

  • a. fileobject.readlines( sizehint );

Q. In file handling, what does this terms means “r, a”?

a. read, append

b. append, read

c. write, append

d. none of the mentioned

  • a. read, append

Q. What is the use of “w” in file handling?

a. read

b. write

c. append

d. none of the mentioned

  • b. write

Q. What is the use of “a” in file handling?

a. read

b. write

c. append

d. none of the mentioned

  • c. append

Q. Which function is used to read all the characters?

a. read()

b. readcharacters()

c. readall()

d. readchar()

  • a. read()

Q. Which function is used to read single line from file?

a. readline()

b. readlines()

c. readstatement()

d. readfullline()

  • b. readlines()

Q. Which function is used to write all the characters?

a. write()

b. writecharacters()

c. writeall()

d. writechar()

  • a. write()

Q. Which function is used to write a list of string in a file?

a. writeline()

b. writelines()

c. writestatement()

d. writefullline()

  • a. writeline()

Q. Which function is used to close a file in python?

a. close()

b. stop()

c. end()

d. closefile()

  • a. close()
Subscribe Now

Get All Updates & News