What makes a directory a regular Python package?
Correct answer D. It contains an __init__.py file
Topic / 88 questions
Page 3 of Python multiple-choice questions with answers. Tap an option to check yourself.
Page 3 of 5
Correct answer D. It contains an __init__.py file
Correct answer D. Its code runs only once; later imports reuse the cached module from sys.modules
Correct answer C. KeyboardInterrupt inherits from BaseException, not from Exception
Correct answer C. Exception
Correct answer A. tuple
Correct answer B. Types belong to objects and are checked at runtime, so a name can be rebound to a value of a different type
Correct answer D. IndentationError
Correct answer A. In the function's __doc__ attribute
Correct answer B. False
Correct answer D. 6 0
Correct answer A. True False False
Correct answer B. 2 4
Correct answer B. True False
Correct answer B. [('a', 1), ('b', 2)]
Correct answer B. [1, 2, 3] None
Correct answer C. [2, 2, 2]
Correct answer B. [1, 9]
Correct answer D. {1: 'b'}
Correct answer C. ['b', 'a', 'c']
Correct answer A. 1