-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguess_age.py
50 lines (39 loc) · 1.9 KB
/
guess_age.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
# ---------------------------------------------------------------------------------------
# **DOCUMENTATION**
# Take a user's name and birth year. Safely make that year an integer,
# then calculate when they'll turn 25, 50, 75, and 100. Tell 'em!
# what year will they turn 25, 50, 75, 100 ?
# print out when those years are?
# don't print any ages that have already past...
# print(name, "you'll be" age "in the Year, " year)
name = input("what is your name ")
dob_year = int(input("what is your birth year? "))
less_than_present = 2017 - dob_year # less_than_present (current_age)
if less_than_present <= 25:
calc_future_age = 25 - less_than_present
future_year = 2017 + calc_future_age # calc_future_age (turn_25, etc...)
future_age = future_year - dob_year
# print(name + ", you'll be " + future_age
#", in the year " + future_year)
print("You'll turn 25 in the year {}, {}".format(future_year, name))
if less_than_present <= 50:
calc_future_age = 50 - less_than_present
future_year = 2017 + calc_future_age
future_age = future_year - dob_year
#print(name + ", you'll be " + future_age
#", in the year " + future_year)
print("You'll turn 50 in the year {}, {}".format(future_year, name))
if less_than_present <= 75:
calc_future_age = 75 - less_than_present
future_year = 2017 + calc_future_age
future_age = future_year - dob_year
#print(name + ", you'll be " + future_age
#", in the year " + future_year)
print("You'll turn 75 in the year {}, {}".format(future_year, name))
if less_than_present <= 100:
calc_future_age = 100 - less_than_present
future_year = 2017 + calc_future_age
future_age = future_year - dob_year
#print(name + ", you'll be " + future_age
#, in the year " + future_year)
print("You'll turn 100 in the year {}, {}".format(future_year, name))