SRE
Mastery
Course
Stats
← Back
🐍 Python Foundations
Q1/8
+0 XP
💡 Key Concept
▲
Python supports chained comparisons: if 1 <= x <= 10: is valid and clean. Both A and B work.
In Python, how do you check if a number is between 1 and 10?
A
if 1 <= x <= 10:
B
if x > 1 and x < 10:
C
Both A and B work
D
if x in range(1,10):