0
0
Pythonprogramming~20 mins

Arithmetic operators in Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Arithmetic Operator Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of mixed arithmetic operations
What is the output of this Python code?
Python
result = 10 + 4 * 3 - 6 / 2
print(result)
A19.0
B22.0
C20.0
D18.0
Attempts:
2 left
💡 Hint
Remember the order of operations: multiplication and division happen before addition and subtraction.
Predict Output
intermediate
2:00remaining
Integer division and modulo output
What will be printed by this code?
Python
a = 17
b = 5
print(a // b, a % b)
A2 3
B3 3
C2 2
D3 2
Attempts:
2 left
💡 Hint
Integer division (//) gives the quotient without remainder, modulo (%) gives the remainder.
Predict Output
advanced
2:00remaining
Result of chained arithmetic with parentheses
What is the output of this code snippet?
Python
value = (8 + 2) * (5 - 3) ** 2 / 2
print(value)
A40.0
B20.0
C100.0
D50.0
Attempts:
2 left
💡 Hint
Calculate inside parentheses first, then exponentiation, then multiplication and division.
Predict Output
advanced
2:00remaining
Output of negative number exponentiation
What does this code print?
Python
print(-3 ** 2)
A-9
B9
CError
D-6
Attempts:
2 left
💡 Hint
Exponentiation has higher priority than the unary minus.
🧠 Conceptual
expert
2:00remaining
Understanding float division precision
What is the output of this code?
Python
result = 0.1 + 0.2
print(result == 0.3)
ANone
BTrue
CFalse
DError
Attempts:
2 left
💡 Hint
Floating point numbers can have small precision errors.