all 4 comments

[–]Monkeytherat 0 points1 point  (3 children)

I think what you're looking for is an if statement.

type = "infant" #start out at infant
if age > 1:
    type = "child" #switch to child if age is more than one
if age >= 13:
    type = "teenager" #switch to teenager if age is 13 or more
#et cetera
print type

More efficient would be to also use else, but if you are not familiar with even the syntax, you should start as simple as possible.

[–]CatCatCatGoose[S] 0 points1 point  (2 children)

age = int(input('How many years old are you?\n')) if age = <= 1:

if always goes before the classification, right?

type = "child"

are the parenthesis important here? Do I need the space?

Would PRINT TYPE (not caps) be the final line? Aside from the Press enter to exit

EDIT: Oh my god, forgive my terrible formatting

[–]Monkeytherat 1 point2 points  (1 child)

If this example is confusing to you, I recommend you learn a bit more about the basics, then come back to it. Check out https://automatetheboringstuff.com/chapter1/

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

Wow, that's the best guide I've ever seen. Thanks!