In which Python version was the match statement for structural pattern matching introduced?
Correct answer B. Python 3.10
Subject / 929 questions
Page 37 of Programming multiple-choice questions with answers. Tap an option to check yourself.
Page 37 of 47
Correct answer B. Python 3.10
Correct answer D. case _:
Correct answer D. Nothing; it is a placeholder where a statement is syntactically required
Correct answer D. When the loop condition becomes false without a break being executed
Correct answer D. Use items=None and create the list inside the function when items is None
Correct answer D. None
Correct answer B. Local, Enclosing, Global, Built-in
Correct answer B. It lets the inner function rebind a variable in the nearest enclosing function scope
Correct answer D. Its body must be a single expression
Correct answer A. RecursionError
Correct answer A. So the code inside runs when the file is executed directly but not when it is imported
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 D. [[1, 0], [1, 0]]
Correct answer B. 3 4
Correct answer C. int tuple
Correct answer A. 1
Correct answer C. ['b', 'a', 'c']