FINAL EXAM Q-BANK MASTERY: FEATURING VERIFIED EXAM
QUESTIONS, ACCURATE ANSWERS, AND DETAILED
COMPETENCY RATIONALES – THE ONLY RESOURCE YOU
NEED FOR A GUARANTEED A+ PASS
Question 1
What is the correct way to create a variable
named age with the value 25 in Python?
A) age == 25
B) age := 25
C) age = 25
D) int age = 25
Answer: C) age = 25
Rationale: The assignment operator = is used to
assign a value to a variable in Python. Option A uses
comparison (==), Option B uses the walrus operator
(valid but not standard for simple assignment), and
Option D uses C-style syntax .
Question 2
1|Page
,Which symbol begins a single-line comment in
Python?
A) //
B) #
C) /*
D) %
Answer: B) #
Rationale: The # symbol is used to begin a single-
line comment in Python. Everything after # on that
line is ignored by the interpreter .
Question 3
What is the output of print(type("Hello"))?
A) <class 'int'>
B) <class 'str'>
C) <class 'float'>
D) <class 'bool'>
Answer: B) <class 'str'>
2|Page
,Rationale: The type() function returns the data type
of the argument. "Hello" is a string (str), which is a
sequence of characters enclosed in quotes .
Question 4
Which of the following is a Boolean value in
Python?
A) "True"
B) true
C) True
D) 1
Answer: C) True
Rationale: Python's Boolean values
are True and False (capitalized). "True" (A) is a
string, true (B) is not a valid keyword (case matters),
and 1 (D) is an integer that evaluates to True in a
Boolean context but is not itself a Boolean .
Question 5
3|Page
, What is the output of bool(0)?
A) True
B) False
C) 0
D) Error
Answer: B) False
Rationale: In Python, 0 is considered False when
converted to a Boolean. Any non-zero number
(positive or negative) is considered True .
Question 6
What is the output of bool("") (empty string)?
A) True
B) False
C) None
D) Error
Answer: B) False
4|Page