File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import datetime
2+
3+
4+ def print_header ():
5+ print ('----------------------' )
6+ print (' BIRTHDAY APP' )
7+ print ('----------------------' )
8+ print ()
9+
10+
11+ def get_birthday_from_user ():
12+ print ("When were you born? " )
13+ year = int (input ("Year [YYYY]: " ))
14+ month = int (input ("Month [MM]: " ))
15+ day = int (input ("Day [DD]: " ))
16+
17+ birthday = datetime .date (year , month , day )
18+ return birthday
19+
20+
21+ def compute_days_between_dates (original_date , target_date ):
22+ this_year = datetime .date (target_date .year , original_date .month , original_date .day )
23+ dt = this_year - target_date
24+ return dt .days
25+
26+
27+ def print_birthday_information (days ):
28+ if days < 0 :
29+ print ("You had your birthday {} days ago this year." .format (- days ))
30+ elif days > 0 :
31+ print ("Your birthday is in {} day." .format (days ))
32+ else :
33+ print ("Happy birthday!" )
34+
35+
36+ def number_of_days (args ):
37+ pass
38+
39+
40+ def main ():
41+ print_header ()
42+ bday = get_birthday_from_user ()
43+ today = datetime .date .today ()
44+ number_of_days = compute_days_between_dates (bday , today )
45+ print_birthday_information (number_of_days )
46+
47+
48+ main ()
Original file line number Diff line number Diff line change 1919eq_right = eq_right / eq_left_left
2020print (eq_right )
2121
22- # https://code.sololearn.com/cZJeTyhTIexH/#py
22+ def sdfsdfsd ():
23+ pass
24+
You can’t perform that action at this time.
0 commit comments