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

From 646 to 660 of 820

Q. k = foo() print(k)

a. 1

b. 2

c. 3

d. error, there is more than one return statement in a single try-finally block

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. g=f(8) print(next(g))

a. 8

b. 9

c. 7

d. error

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

Q. Which of these definitions correctly describes a module?

a. denoted by triple quotes for providing the specification of certain program elements

b. design and implementation of specific functionality to be incorporated into a program

c. defines the specification of how it is to be used

d. any program that reuses code

  • b. design and implementation of specific functionality to be incorporated into a program

Q. Which of the following is not an advantage of using modules?

a. provides a means of reuse of program code

b. provides a means of dividing up tasks

c. provides a means of reducing the size of the program

d. provides a means of testing individual parts of the program

  • c. provides a means of reducing the size of the program
Subscribe Now

Get All Updates & News