-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from datetime import datetime | ||
from typing import Tuple | ||
|
||
|
||
def ask_month_day_year(prompt: str = "Enter your birthday") -> Tuple[int, int, int]: | ||
date = input(f"{prompt} in the format: MM/DD/YYYY ") | ||
month, day, year = (int(x.strip()) for x in date.split("/")) | ||
return month, day, year | ||
|
||
|
||
def day_of_the_week(year, month, day): | ||
return f"{datetime(year, month, day):%A}" | ||
|
||
|
||
month, day, year = ask_month_day_year() | ||
print(f"You were born on a {day_of_the_week(year, month, day)}.") |