Which fix removes the bug?
x = 7
if x > 0 and < 10:
print('digit')
- Replace
andwith&&here - Wrap the test in brackets
- Repeat x:
x > 0 and x < 10 - Change
<to<=in the test
Each side of
Play Problem Solving ▸
and must be a full comparison; Python also allows 0 < x < 10.