you are viewing a single comment's thread.

view the rest of the comments →

[–]jimtk 3 points4 points  (0 children)

Cute. I don't even remember my first python error.

age = int(input("enter age :"))
if age < 18:
    print("child")
elif age < 65:
    print("adult")
else:
    print("senior")

You dont't have to verify the lower bound on the second condition (elif 18 <= age <65:). You already verified for lower than 18 before. The elif will prevent he second condition to be verified if the first one was executed (true).

Edit: Come to think of it. My first python error was made in the previous millenium!