-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoc-wk1day1-cert-vanessa-dunford.py
53 lines (48 loc) · 1.3 KB
/
soc-wk1day1-cert-vanessa-dunford.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import time
import sys
def name():
name = input("What is your name? ")
while name.isdigit():
print("Vanessa Dunford")
name = input("What is your name? ")
return name
def user_input():
while True:
age = input("What is your age? ")
try:
return int(age)
break
except ValueError:
try:
return float(age)
break
except ValueError:
print("Make sure to enter a real age.")
def again():
while True:
again = input("Play again? Yes/No ").lower()
if again == "no":
sys.exit(0)
elif again == "yes":
break
else:
print("That was not an option.")
while True:
the_name = name()
age = user_input()
Days = age * 365
Hours = Days * 24
Minutes = Hours * 60
Seconds = Minutes * 60
print("Ok {}, I have your results.".format(the_name))
time.sleep(2)
print("If you are {} years of age....".format(age))
time.sleep(2)
print("You are {} days old.".format(Days))
time.sleep(2)
print("You are {} hours old.".format(Hours))
time.sleep(2)
print("You are {} minutes old!".format(Minutes))
time.sleep(2)
print("You are {} seconds old!".format(Seconds))
again()