Question: PYTHON Modify the given program so it prints Happy Birthday if today's persons birthday. Ex. input =03/12/1995 and today's date = 03/12/2017, the person just
PYTHON
Modify the given program so it prints "Happy Birthday" if today's persons birthday.
Ex. input =03/12/1995 and today's date = 03/12/2017, the person just turned 21 today so he/she is welcome and also print Happy Birthday.
PYTHON

import datetime |from dateut?1.relativedelta ?mport relativedelta todaydatetime.date.today () bday-input-: input ('Enter birthday mm/ dd/ year format: ') in month, day, year bday_input.split("/') bday datetime.date (int (year), int (month), int (day) ) diff relativedelta (today, bday) if diff.years 21: print('Welcome! ' else: print('You are not old enough')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
