Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started