0
Using 'and' vs a range?
In Python, why does there seem to be a preference of using 'and' statements rather than a range? if (age > 10) and (age < 18): vs if 10 < age < 18:
2 Answers
+ 3
It'll do the same thing, the second one is just shorter. They both set the same bounderies
https://code.sololearn.com/cY4Z79vANdc3/?ref=app
+ 3
Second variant is better:
if 10 < age < 18: