Programming (Python ) 2026/2027 Latest
Update Q&A Actual Questions And
Verified Answers ,Guaranteed Pass
Graded A+
Question 1: What is the output of the following code?
python
x=5
y = 10
print(x + y)
A) 510 B) 15 C) Error D) 5 10
Answer: B
Rationale: The + operator performs arithmetic addition when both operands are integers. The values 5 and 10 are
added together to produce 15.
Question 2: Which of the following is a valid variable name in Python?
A) 2ndName B) my-name C) my_name D) class
Answer: C
Rationale: Python variable names cannot start with a digit (A), cannot contain hyphens (B), and cannot be reserved
keywords like class (D). Underscores are allowed and commonly used.
1|Page SUCCESS!!!
,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
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".
Question 4: Which data type is immutable?
A) list B) dict C) set D) tuple
Answer: D
Rationale: Tuples cannot be changed after creation, making them immutable. Lists, dictionaries, and sets are
mutable.
Question 5: What is the output of the following code?
python
print(type())
A) int B) float C) double D) str
Answer: B
Rationale: In Python, the division operator / always returns a float, even when numbers divide evenly.
evaluates to 5.0.
Question 6: What is the value of x?
python
x=4+3*2
A) 14 B) 10 C) 11 D) 7
Answer: B
Rationale: Multiplication occurs before addition. 3 * 2 = 6; 4 + 6 = 10.
Question 7: Which data type stores whole numbers?
A) float B) str C) int D) bool
Answer: C
Rationale: Integers (int) represent whole numbers. Floats are decimal numbers, strings are text, and booleans are
True/False.
2|Page SUCCESS!!!
,Question 8: What is printed?
python
print("5" + "3")
A) 8 B) 53 C) Error D) 5 3
Answer: B
Rationale: String concatenation joins strings together. "5" + "3" results in "53".
Question 9: Which operator means "not equal"?
A) = B) == C) != D) <>
Answer: C
Rationale: != is the Python operator for inequality comparison.
Question 10: What is the output of print(3 ** 3)?
A) 9 B) 27 C) 6 D) 12
Answer: B
Rationale: The ** operator performs exponentiation. 3 ** 3 = 3 × 3 × 3 = 27.
Question 11: What is the result of 15 % 4?
A) 3 B) 3.75 C) 4 D) 15
Answer: A
Rationale: The modulo operator % returns the remainder. 15 ÷ 4 = 3 with a remainder of 3.
Question 12: What is the result of 15 // 4?
A) 3 B) 3.75 C) 4 D) 15
Answer: A
Rationale: The floor division operator // returns the integer quotient, discarding the remainder. 15 // 4 = 3.
Question 13: What will this code print?
python
x = "Hello"
print(x[1])
A) H B) e C) l D) o
Answer: B
Rationale: String indexing in Python starts at 0. Index 0 is 'H', index 1 is 'e'.
Question 14: What is the output?
python
x = 10
3|Page SUCCESS!!!
, if x > 5:
print("A")
A) A B) B C) Error D) Nothing
Answer: A
Rationale: The condition x > 5 evaluates to True (10 > 5), so the print statement executes.
Question 15: Which of the following is NOT a valid Python data type?
A) int B) float C) double D) str
Answer: C
Rationale: Python does not have a separate double type. Floating-point numbers are all float in Python.
Question 16: What is the output?
python
print()
A) 3 B) 3.33 C) 3.3333333333333335 D) 3.0
Answer: C
Rationale: The / operator always returns a float, even when numbers don't divide evenly. Python uses double-
precision floating-point arithmetic.
Question 17: What is the output?
python
print(10 // 3)
A) 3 B) 3.33 C) 3.0 D) 4
Answer: A
Rationale: Floor division // returns the integer quotient, discarding any remainder. 10 // 3 = 3.
Question 18: What is the output?
python
print(10 % 3)
A) 3 B) 1 C) 0 D) 3.33
Answer: B
Rationale: The modulo operator % returns the remainder. 10 ÷ 3 = 3 remainder 1.
Question 19: What is the output?
python
print(bool(0))
4|Page SUCCESS!!!