Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions