**PLEASE DO THIS IN PYTHON**
The date February 9th, 2018, is a magic date because when we write it in the following format, the month times the day equals the year:
2/10/20 Write a script that asks the user to enter a month (in numeric form), a day, and a two-digit year.
You should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic.
Screenshot of the code on left-hand side and output on the right-hand side:
The Code Used:
month = int(input("Enter the month: ")) # Asking the user for the month input. day = int(input("Enter the day: ")) # Asking the user for the day input. year = int(input("Enter the last two digit of the year: ")) # taking year input. if month*day == year: # Here we check if day*month is equal to year or not. print("Date is magic.") # if the above condition holds true. else: # if day*month is not equal to year than the following message is printed. print("Date is not magic")
I hope you like the solution. In case of any doubts regarding the solution feel free to ask it in the comment section. If you like the solution please give a thumbs up.
Get Answers For Free
Most questions answered within 1 hours.