Created
December 20, 2023 05:04
-
-
Save ajeebkp23/63ec4c291cc62a7363f858ba5ee359f9 to your computer and use it in GitHub Desktop.
Boring Birthdays
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
#!/usr/bin/env python3 | |
import sys | |
from datetime import datetime | |
#print(len(sys.argv)) | |
if len(sys.argv) == 4: | |
birthday = " ".join(sys.argv[1:4]) | |
elif len(sys.argv) == 3: | |
birthday = " ".join(sys.argv[1:3]) + " x" | |
elif len(sys.argv) == 1: | |
print( | |
"Enter your Birthday in dd mmm X format. where dd is 2 digit date, mmm is 3 digit month like dec/jan/etc, X is simply x or X - a place holder" | |
) | |
birthday = input() | |
else: | |
birthday = sys.argv[1] | |
birthday_date = datetime.strptime(birthday, "%d %b X") | |
today = datetime.now() | |
if today.day == birthday_date.day and today.month == birthday_date.month: | |
print("Today is your birthday!") | |
else: | |
print("Today is not your birthday.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to run this