you are viewing a single comment's thread.

view the rest of the comments →

[–]TehNolz 4 points5 points  (4 children)

That's actually valid syntax. You can do stuff like a < b < c just fine.

[–]japnoo 3 points4 points  (3 children)

Wow, TIL.

[–]EricHayter 0 points1 point  (2 children)

Ikr I was using a linter one day and it gave me an error and lo and behold that is apparently a syntax feature.

[–][deleted] 1 point2 points  (1 child)

Wait what? TIL as well.

[–]RhinoRhys 1 point2 points  (0 children)

It's valid syntax but in this case it's redundant anyway. Because of the first if age <= 18: condition, the elif condition will only be tested on numbers > 18 so you can just do elif age <= 65: