Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Special Date
- print("The date February 10, 2020 is special because when it is written in the following format the month times the day equals the year : 2/10/20.")
- #Inputs
- while True:
- try:
- userInputMonth = int(input("Please enter a valid month:"))
- except ValueError:
- print("Please provide a numeric input for the month. Try again...")
- try:
- userInputDay = int(input("Please enter a valid day:"))
- except ValueError:
- print("Please provide a numeric input for the day:")
- try:
- userInputYear = int(input("Please enter a valid two-digit-year:"))
- except ValueError:
- print("Please provide a numeric input for the year.")
- print()
- if userInputMonth * userInputDay == userInputYear:
- print("The date you provided " + str(userInputMonth) + "/" + str( userInputDay) + "/" + \
- str(userInputYear) + " is the special date.")
- else:
- print("The date you provided " + str(userInputMonth) + "/" + str(userInputDay) + "/" + \
- str(userInputYear) + " is not the special date.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement