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

From 181 to 195 of 820

Q. Which function overloads the >> operator?

a. more    ()

b. gt    ()

c. ge    ()

d. none of the mentioned

  • d. none of the mentioned

Q. Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?

a. add    (),     str    ()

b. str    (),     add    ()

c. sum    (),     str    ()

d. str    (),     sum    ()

  • a.     add    (),     str    ()

Q. Which function overloads the // operator?

a. div    ()

b. ceildiv    ()

c. floordiv    ()

d. truediv    ()

  • c.     floordiv    ()

Q. How many except statements can a try- except block have?

a. zero

b. one

c. more than one

d. more than zero

  • d. more than zero

Q. When is the finally block executed?

a. when there is no exception

b. when there is an exception

c. only if some condition that has been specified is satisfied

d. always

  • d. always

Q. What happens when ‘1’ == 1 is executed?

a. we get a true

b. we get a false

c. an typeerror occurs

d. a valueerror occurs

  • b. we get a false

Q. Which of the following is not an exception handling keyword in Python?

a. try

b. except

c. accept

d. finally

  • c. accept

Q. )) type(g)

a. class <’loop’>

b. class <‘iteration’>

c. class <’range’>

d. class <’generator’>

  • d. class <’generator’>

Q. + '3'

a. nameerror

b. indexerror

c. valueerror

d. typeerror

  • d. typeerror

Q. 43')

a. importerror

b. valueerror

c. typeerror

d. nameerror

  • b. valueerror

Q. Which of the following statements is true?

a. the standard exceptions are automatically imported into python programs

b. all raised standard exceptions must be handled in python

c. when there is a deviation from the rules of a programming language, a semantic error is thrown

d. if any exception is thrown in try block, else block is executed

  • a. the standard exceptions are automatically imported into python programs

Q. Which of the following is not a standard exception in Python?

a. nameerror

b. ioerror

c. assignmenterror

d. valueerror

  • c. assignmenterror

Q. An exception is                          

a. an object

b. a special function

c. a standard module

d. a module

  • a. an object
Subscribe Now

Get All Updates & News