Avatar of snhandle
snhandle
 asked on

python calculating birthday

I am new to Python. try to learn. I want to create program where it should ask for birthday just day and month using input function and if the birthday is in the future then should give message that how many days left for your birthday, if it   is already passed then it should give message that your birthday was that many days ago and if it is today then should show message ‘happy birthday’
I spent lot of time but no luck
Python

Avatar of undefined
Last Comment
Subodh Tiwari (Neeraj)

8/22/2022 - Mon
aikimark

What is the current state of your Python code?
snhandle

ASKER
import datetime
today_date = datetime.date.today()
birthday = input(“enter your birth date (DD/MM):”)
if x > 0
print(your birthday has already passed by” (x))
if x < 0
print(“u still have (x) days left”)
if x = 0
print(“happy birthday”)
ASKER CERTIFIED SOLUTION
Subodh Tiwari (Neeraj)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
snhandle

ASKER
Always very helpful!! Thanks a lot
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Subodh Tiwari (Neeraj)

You're welcome!