[Solved]Modify Python Program Print Happy Birthday Today Person S Birthday Remember Person Birthda Q37067679
Modify this python program to print “Happy Birthday!” if todayis the person’s birthday. Remember that a person has a birthdayevery year. It is not likely that a newborn will wonder into a barthe day s/he is born. Your program should print “Happy Birthday!”if today’s month and day are the same as the person’s birthday. Forexample, if person is born November 3, 1984 and today is November3, 2019, then a happy birthday message should print.
The code:
import datetimefrom dateutil.relativedelta import relativedeltatoday = datetime.date.today()today”””from .. import * considered bad form.”””# from datetime import *”””This is better style.”””from datetime import datetodaytype(today)today.monthtoday.day#@title Enter birthdaybday_input = “1995-06-15″ #@param {type:”date”}bday_input = input(‘Enter your birthday: ‘)bday_inputbday_comps = bday_input.split(‘-‘)year = bday_comps[0]month = bday_comps[1]day = bday_comps[2]print(month, day, year)type(year)year, month, day = bday_input.split(‘-‘)print(month, day, year)type(year)bday = datetime.date(int(year), int(month), int(day))bdaydiff = relativedelta(today, bday)diffdiff.yearsif diff.years >= 21: print(‘Welcome!’) print(‘Stamp hand.’)else: print(‘Piss off kid.’)print(‘Next!’)
Expert Answer
Answer to Modify this python program to print “Happy Birthday!” if today is the person’s birthday. Remember that a person has a bi… . . .
OR

