Python script that asks you for your age then, tells you if you are a kid, a teen, or an adult.
import time
x = int(input("How old are you? "))
if x in range (1,13):
print("You are", x, "which makes you a kid")
input('Press Enter to exit')
elif x in range (13,18):
print("You are", x, "which makes you a teenager")
input('Press Enter to exit')
elif x > 17:
print("You are", x, "which makes you a adult")
input('Press Enter to exit')
else:
print("Bruh you need to put a real number")
input('Press Enter to exit')
## made by james ;)
New Code using def
def EtoE():
input('Press Enter to exit')
def pr(x,y):
print("You are", x, "which makes you a" , y)
def age(x):
if x in range (1,13):
pr(x, "kid")
EtoE()
elif x in range (13,18):
pr(x, "teenager")
EtoE()
elif x > 17:
pr(x, "adult")
EtoE()
else:
print("Bruh you need to put a real number")
EtoE()
x = int(input("How old are you? "))
age(x)
## made by james ;)
0 Comments