What does 5 evaluate to ?
A. +5
B. -11
C. +11
D. -5
Correct Answer :
A). +5
Explanation : The expression “5” simply evaluates to the positive number 5. In mathematics, it represents a positive integer, so it is equivalent to +5.
Core Explanation:
- Numeric
Literal:- 5 is
an integer literal (base 10) - Python
interprets it as the numeric value 5 - Type: <class
‘int’> (verified with type(5))
- 5 is
- Comparison
with Similar Expressions:
Expression | Evaluation | Data Type | Description |
5 | Integer 5 | int | Whole number literal |
5.0 | Floating point 5.0 | float | Decimal number literal |
“5” | String “5” | str | Text character, not a number |
5 + 2 | Integer 7 | int | Arithmetic operation result |
- Key
Characteristics of Integers in Python:- No
decimal points (unlike floats) - Can
be positive, negative, or zero ( 5, 0, +5) - Support
mathematical operations:
- No
python
print(5 * 2) # 10
(int)
print(5 / 2) # 2.5
(float division converts to float)
print(5 // 2) # 2
(int floor division)
Practical Verification:
Test in Python interpreter:
python
>>> 5
5 #
Output value
>>> type(5)
<class ‘int’> #
Confirmed integer type
>>> 5 == 5.0
# Value equality check
True # Same
numeric value (but different types)
>>> 5 == “5” # Compare int vs string
False #
Different types and values
Common MCQ Traps to Avoid:
- Confusing 5 with “5”:
- 5 is
a number → can do math - “5” is
text → “5” + “2” = “52” (concatenation)
- 5 is
- Assuming
automatic type conversion:
python
print(5 + int(“2”)) # 7 (explicit conversion works)
print(5 + “2”) # TypeError (no implicit conversion)
- Misinterpreting
division:- 5 /
2 → 2.5 (float) - 5
// 2 → 2 (int floor division)
- 5 /
Sample MCQ Scenarios:
Q1: What is the output of print(type(5))?
a) <class ‘str’>
b) <class ‘float’>
c) <class ‘int’> ✓
Q2: Which evaluates to an integer?
a) “5”
b) 5.0
c) 5 ✓
d) ‘5’
Q3: What does 5 + 3 * 2 evaluate to?
a) 16
b) 11 ✓ (Order: 3*2=6 → 5+6)
c) 13
d) SyntaxError
Pro Tip:
Use Python’s interactive mode (python in terminal) to
instantly test expressions during study. This builds intuition for how Python
evaluates literals and operations.
Key Takeaway:
5 is always an integer literal in Python. Understanding
this distinction between numbers (5), decimals (5.0), and strings (“5”)
is crucial for avoiding type errors and acing Python MCQs.