OF PROGRAMMING (PYTHON) APPROVED OBJECTIVE ASSESSMENT (OA)
EXAM TESTBANK 2026/2027 PRACTICE QUESTIONS AND STUDY GUIDE
COMPLETE ACCURATE EXAM REAL QUESTIONS AND CORRECT DETAILED
ANSWERS WITH RATIONALES (100% CORRECT VERIFIED SOLUTIONS)
CURRENTLY UPDATED VERSION |GUARANTEED PASS A+ |FULL REVISED
EXAM |JUST RELEASED
Question 1
What is the output of the following code?
python
x=5
y = 10
print(x + y)
A) 510
B) 15
C) 15
D) 5 10
Correct Answer: B
Rationale: The + operator performs arithmetic addition when both
operands are integers. The values 5 and 10 are added to produce 15.
If the operands were strings, + would concatenate them, but here
they are integers, so numeric addition occurs.
Question 2
Which of the following is a valid variable name in Python?
,A) 2ndName
B) my-name
C) my_name
D) class
Correct Answer: C
Rationale: Python variable names cannot start with a digit
(eliminating 2ndName), cannot contain hyphens (eliminating my-
name), and cannot be reserved keywords like class (eliminating
class). Underscores are allowed and commonly used, so my_name is
valid.
Question 3
What is the output of the following code?
python
x = "5"
y=2
print(x * y)
A) 10
B) Error
C) "55"
D) 5
Correct Answer: C
Rationale: When a string is multiplied by an integer, Python repeats
(concatenates) the string that many times. The string "5" is repeated
2 times, resulting in "55". This is known as string replication.
,Question 4
Which data type is immutable?
A) list
B) dict
C) set
D) tuple
Correct Answer: D
Rationale: Tuples cannot be changed after creation, making them
immutable. Lists, dictionaries, and sets are all mutable data types
that can be modified after creation.
Question 5
What is the output of the following code?
python
print(type())
A) int
B) float
C) double
D) str
Correct Answer: B
Rationale: In Python, the division operator / always returns a float,
even if the numbers divide evenly. evaluates to 5.0, and
type(5.0) returns float. Python does not have a separate double type.
, Question 6
What will this code print?
python
x = "Hello"
print(x[1])
A) H
B) e
C) l
D) o
Correct Answer: B
Rationale: String indexing in Python starts at 0. Index 0 is 'H', index
1 is 'e', index 2 is 'l', index 3 is 'l', and index 4 is 'o'. The code prints
the character at index 1, which is 'e'.
Question 7
What is the output of the following code?
python
print(2 ** 3)
A) 6
B) 8
C) 9
D) 5
Correct Answer: B
Rationale: The ** operator performs exponentiation. 2 ** 3 means 2
raised to the power of 3, which equals 2 × 2 × 2 = 8.