Skip to content

Instantly share code, notes, and snippets.

@Bktero
Created September 12, 2017 06:35
Show Gist options
  • Save Bktero/2a2ab3f80d8e0cd7304e3b8d16d670ce to your computer and use it in GitHub Desktop.
Save Bktero/2a2ab3f80d8e0cd7304e3b8d16d670ce to your computer and use it in GitHub Desktop.
[Python] Is it your birthday?
from datetime import datetime
from datetime import date
birth = datetime.strptime("08-08-1987", "%d-%m-%Y").date()
today = date.today()
if birth.day == today.day and birth.month == today.month:
age = today.year - birth.year
print("It's your birthday! You're", age,"! : )")
print("Let's celebrate!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment