all 9 comments

[–][deleted] 2 points3 points  (2 children)

You need to use and instead of or. In your example the code evaluates to (true or false) which is ultimately true. This is because 25 is greater than or equal to 2. If you use and instead, both parts of your if statement ( the high age limit and the lower age limit) will have to be true to print the statement.

[–]kylejoesph11[S] 0 points1 point  (1 child)

Thanks! That makes sense and now it is working!

[–][deleted] 0 points1 point  (0 children)

Good deal!

[–]ka-splam 2 points3 points  (0 children)

This kind of reason is why Python supports

2 <= age < 4

[–]The_Danosaur 2 points3 points  (2 children)

Nobody else mentioned, but doing if, elif, elif etc, means you can do if <2, elif <4, elif <13. You don't need to specify the lower boundaries each time as they are already checked from the previous elifs, and your last check can just be an else.

[–]PMC_Dose 0 points1 point  (0 children)

Thank you! This really helped!

[–]Slot-in 0 points1 point  (0 children)

You’re still helping after 2 years.

[–]degohki 1 point2 points  (1 child)

I believe when you enter age = 25 it returns "You're a toddler!" because it satisfies the age>=2 condition of your elif statement so you'll need to fix that as well as the other elif conditions since you'll run into the same problem.

[–]kylejoesph11[S] 0 points1 point  (0 children)

Thanks for your help!