I am trying to make a program (as a beginner) to have different responses according to the user’s age. I can’t figure out how to find the right command to range between two ages. PS: I’m on Thonny.
This is the program:
name = input(“What’s your name? “)
age = int(input(“And your age? “))
if age <= 11:
print(“Hi there, little ” + name + “!”)
if( age <= 12 and age <= 19 ):
print(“Hey” + name)
if age <=19 and age<=25:
print(“Hello ” + name + “.”)
I don’t have anyone to ask and my Computer Studies teacher at school hates me.
submitted by /u/swornpythoner
[link] [comments]
r/learnpython I am trying to make a program (as a beginner) to have different responses according to the user’s age. I can’t figure out how to find the right command to range between two ages. PS: I’m on Thonny. This is the program: name = input(“What’s your name? “) age = int(input(“And your age? “)) if age <= 11: print(“Hi there, little ” + name + “!”) if( age <= 12 and age <= 19 ): print(“Hey” + name) if age <=19 and age<=25: print(“Hello ” + name + “.”) I don’t have anyone to ask and my Computer Studies teacher at school hates me. submitted by /u/swornpythoner [link] [comments]
I am trying to make a program (as a beginner) to have different responses according to the user’s age. I can’t figure out how to find the right command to range between two ages. PS: I’m on Thonny.
This is the program:
name = input(“What’s your name? “)
age = int(input(“And your age? “))
if age <= 11:
print(“Hi there, little ” + name + “!”)
if( age <= 12 and age <= 19 ):
print(“Hey” + name)
if age <=19 and age<=25:
print(“Hello ” + name + “.”)
I don’t have anyone to ask and my Computer Studies teacher at school hates me.
submitted by /u/swornpythoner
[link] [comments]