Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from datetime import date
- a=input('Enter your birthdate :')
- b=a.split("/")
- t = date.today()
- d = t.strftime("%d/%m/%Y").split("/")
- if int(d[0])==int(b[0]) and int(d[1])==int(b[1]):
- print('Happy Birthday !')
- elif int(d[0])>=int(b[0]):
- print("You're",int(d[2])-int(b[2]),"years and",int(d[1])-int(b[1]),"months and",int(d[0])-int(b[0]),"days old !" )
- else:
- print("You're",int(d[2])-int(b[2]),"years and",int(d[1])-int(b[1])-1,"months and",int(d[0])-int(b[0])+30,"days old !" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement