Skip to content

Commit 13185b6

Browse files
committed
finished
1 parent 8dcfa7b commit 13185b6

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

birthday_app.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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()

linear_equation_ds.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@
1919
eq_right = eq_right / eq_left_left
2020
print(eq_right)
2121

22-
# https://code.sololearn.com/cZJeTyhTIexH/#py
22+
def sdfsdfsd():
23+
pass
24+

pig.py

Whitespace-only changes.

0 commit comments

Comments
 (0)