(Python) Final Exam 2026 | 200 Practice
Questions & Answers with Explanations | Latest
OA Study Guide
Section 1: Python Fundamentals & Syntax
1. Which symbol begins a single-line comment in Python?
A. // B. # C. /* D. --
Answer: B
Explanation: Python uses # to begin a single-line comment. Everything after the # on that
line is ignored by the interpreter.
2. Which function displays output to the console?
A. display() B. output() C. print() D. console()
Answer: C
Explanation: The built-in print() function sends values or text to standard output.
3. What is printed by this code?
print("Hello")
,A. "Hello" B. Hello C. print("Hello") D. Nothing
Answer: B
Explanation: The quotation marks identify the text as a string but are not printed.
4. Which is a valid Python variable name?
A. 2value B. my-value C. my_value D. my value
Answer: C
Explanation: Python identifiers may contain letters, digits, and underscores but cannot begin
with a digit or contain spaces or hyphens.
5. Which word is a Python keyword?
A. repeat B. function C. class D. define
Answer: C
Explanation: class is a reserved Python keyword and cannot be used as an ordinary
variable name.
6. Python is generally described as which type of language?
A. Interpreted B. Assembly-only C. Machine-only D. Markup-only
Answer: A
Explanation: Python code is executed through the Python interpreter, although Python
implementations internally perform compilation steps such as producing bytecode.
,7. What does indentation primarily define in Python?
A. Variable types B. Code blocks C. Comments D. File names
Answer: B
Explanation: Python uses indentation to indicate blocks belonging to statements such as if,
for, while, and functions.
8. Which statement correctly assigns 25 to age?
A. age == 25 B. age := 25 C. age = 25 D. 25 = age
Answer: C
Explanation: The assignment operator = assigns the value on the right to the variable on the
left.
9. What does len() return?
A. The data type B. The number of items or characters C. The memory address D. The
largest value
Answer: B
Explanation: len() returns the number of elements in a collection or characters in a string.
10. Which statement imports the math module?
A. include math B. using math C. import math D. load math
Answer: C
, Explanation: Python uses the import statement to make a module available to a program.
11. What is the output?
print(2 + 3 * 4)
A. 20 B. 14 C. 24 D. 9
Answer: B
Explanation: Multiplication has higher precedence than addition, so 3 * 4 is calculated first,
producing 14.
12. Which function converts a value to an integer when possible?
A. integer() B. number() C. int() D. whole()
Answer: C
Explanation: Python's built-in int() function converts compatible values to integers.
13. Which function converts a value to a string?
A. str() B. string() C. text() D. char()
Answer: A
Explanation: str() creates a string representation of a value.
14. What type is 3.14?
A. int B. float C. str D. bool