Top 50+ Solved Python Programming MCQ Questions Answer

From 31 to 39 of 39

Q. What is the output of the following?elements = [0, 1, 2]def incr(x): return x+1print(list(map(elements, incr)))

a. [1, 2, 3].

b. [0, 1, 2].

c. error

d. none of the mentioned

  • c. error

Q. What is the output of the following?elements = [0, 1, 2]def incr(x): return x+1print(list(map(incr, elements)))

a. [1, 2, 3].

b. [0, 1, 2].

c. error

d. none of the mentioned

  • a. [1, 2, 3].

Q. Program code making use of a given module is called a ______ of the module.

a. Client

b. Docstring

c. Interface

d. Modularity

  • a. Client

Q. To read the entire remaining contents of the file as a string from a file object infile, we use

a. infile.read(2)

b. infile.read()

c. infile.readline()

d. infile.readlines()

  • b. infile.read()

Q. Suppose t = (1, 2, 4, 3), which of the following is incorrect?

a. print(t[3])

b. t[3] = 45

c. print(max(t))

d. print(len(t))

  • b. t[3] = 45
Subscribe Now

Get All Updates & News