Add how_old.py example for chapter 3
parent
c2ecd85afd
commit
7691e18a5a
@ -0,0 +1,8 @@
|
|||||||
|
age = input("How old are you? ")
|
||||||
|
|
||||||
|
while not age.isnumeric():
|
||||||
|
age = input("Please enter only digits. Try again. How old are you? ")
|
||||||
|
|
||||||
|
age = int(age)
|
||||||
|
print("Great, your are", age, "years old. Next year you'll be", age+1, "!")
|
||||||
|
|
Loading…
Reference in New Issue