(PYTHON) – COMPREHENSIVE PRACTICE EXAM
EXAM OVERVIEW 2026
SECTION 1: BASIC SYNTAX & DATA TYPES (Questions 1–25)
Q1. What is the output of print(type(10/2))?
A) <class 'int'>
B) <class 'float'>
C) <class 'double'>
D) <class 'number'>
Correct ANSWER: B
Rationale: In Python, the / operator performs true division and always returns a float, even when the
numbers divide evenly. = 5.0, so type(5.0) is float.
Q2. Which of the following data types is immutable?
A) list
B) dict
C) set
D) tuple
Correct ANSWER: D
,Rationale: A tuple cannot be changed after creation (immutable), while lists, dictionaries, and sets are
mutable and can be modified after creation.
Q3. What will the following code print?
python
x = "Hello"
print(x[1])
A) H
B) e
C) l
D) o
Correct ANSWER: B
Rationale: String indexing starts at 0 in Python. x[0] is 'H', x[1] is 'e'.
Q4. What is the output of print(3 ** 2)?
A) 6
B) 9
C) 8
D) 5
Correct ANSWER: B
Rationale: The ** operator performs exponentiation. 3² = 9.
,Q5. What does len([1, 2, 3]) return?
A) 2
B) 3
C) 4
D) 1
Correct ANSWER: B
Rationale: The len() function returns the number of elements in a sequence.
Q6. Which operator checks equality in Python?
A) =
B) ==
C) !=
D) ===
Correct ANSWER: B
Rationale: == compares values for equality; = is the assignment operator.
Q7. What is the result of bool([])?
A) True
B) False
C) None
D) Error
, Correct ANSWER: B
Rationale: Empty sequences (list, tuple, string, dict, set) evaluate to False in a Boolean context.
Q8. What is the output of the following code?
python
x=5
y=2
print(x // y)
A) 2.5
B) 2
C) 3
D) 2.0
Correct ANSWER: B
Rationale: The // operator performs floor (integer) division, which divides and rounds down to the
nearest whole number. 5 // 2 equals 2.
Q9. Which of the following is a valid variable name in Python?
A) 2cool
B) cool-variable
C) _cool_variable
D) cool variable
Correct ANSWER: C