r/Python • u/[deleted] • Aug 29 '22
Beginner Showcase Made a thing which takes your age and decides whether or not you’re allowed to use a website or something.
This is very basic, but it is my second project [First was the same, but without the years_from_13 thing and the elif age > 122 thing], and I’m pretty pleased with how it turned out.
age = int(input())
name = input()
years_from_13 = 13-age
if age < 13:
print(f"{name}, you are under 13 years of age. You are not old enough to use this - Come back in {years_from_13} years time.")elif age > 122:
print(f"{name}, did you know that the oldest known person lived to just under 122.5 years old? It seems like you didn't. Nice try, though.")else:
print(f"Welcome, {name}.")
0
Upvotes
1
Aug 29 '22
Cool, now add something else. And keep building, problem solving is hard but extremely rewarding.
9
u/aaronlyy Aug 29 '22
Good job, now you could try to validate if entered input is actually a number or something else and will crash your code.