INTRODUCTION TO PROGRAMING IN
PYTHON EXAM / PYTHON MIDTERM EXAM
2026/2027 AND STUDY GUIDE COMPLETE
ACCURATE EXAM ACTUAL QUESTIONS
AND CORRECT DETAILED ANSWERS
(EXPERT VERIFIED SOLUTIONS) NEWEST
UPDATED VERSION 2026 |GUARANTEED
PASS. (BRAND NEW!) |FULL REV
Q1. What is the output of print(2 ** 3 ** 2)?
A) 64
,Page 2 of 159
B) 512
C) 256
D) 12
Correct Answer: B) 512
Rationale: Exponentiation is right-associative: 2 ** (3 ** 2) =
2 ** 9 = 512.
Q2. Which is a valid variable name?
A) 2var
B) var-2
C) _var2
D) var 2
Correct Answer: C) _var2
Rationale: Variables can start with underscore or letter, not
digit; no spaces/hyphens.
,Page 3 of 159
Q3. Given x = 5, y = 2, what is x // y?
A) 2.5
B) 2
C) 2.0
D) 3
Correct Answer: B) 2
Rationale: // is floor division, returns integer.
Q4. What is the type of 3.0 + 2?
A) int
B) float
C) complex
D) str
Correct Answer: B) float
Rationale: Python converts int to float in mixed arithmetic.
, Page 4 of 159
Q5. Scenario: price = 10, tax = 0.05, total = price + price *
tax. What is total?
A) 10.05
B) 10.5
C) 10
D) 10.50
Correct Answer: B) 10.5
Rationale: price * tax = 0.5, plus 10 = 10.5.
Q6. Which reads user input as a string?
A) input("Enter: ")
B) raw_input("Enter: ")
C) read("Enter: ")
D) get_input("Enter: ")
Correct Answer: A) input("Enter: ")
Rationale: Python 3 input() always returns string.