#If statement
7 messages · Page 1 of 1 (latest)
!eval 2 or 4
✅ Eval - Success
>>> 2 or 4
2
Completed in 0.0448 milliseconds
Why Doesn't This Condition Work?
if age >= 12 and < 18:
and as well as or delineate distinct conditions. So you need to specify the variable in each condition in the statement. Like this
if age >= 12 and age < 18:
Additionally you can chain the greater than, less than, greater than or equal to, and less than or equal to. Like this
if 12 <= age < 18:
Contributed graciously by Zech
Alternatively you could do if value in (2, 4):. Which should give you the result you want