Write a Python program that reads in the month, day, and year
of a date and prints it in the
dd/mm/yyyy format or mm/dd/yyyy format, the format depending
on the user’s preference. The
program also prints the message
It is a magic date
If the product of month and day is equal to the last two
digits of the year. For example, April 20
1980 is a magic date because April (numeric value 4)
multiplied by 20 is equal to 80, the last two
digits of 1980. But June 10, 1961 is not a magic date because
6 * 10 is 60, not 61.
The program reads a date in the first three steps given
1. The program first prompts for the month. The user enters a
value between 1 and 12 (1 for
January, 12 for December, etc.)
2. It then asks for the day of the month. The user enters a
value between 1 and 31. We assume
the user enters a day that is consistent with the month and
year. For example, if the month is
November, the user will not enter 31.
3. The code then prompts for the year. The user enters the
year as a four-digit number.
4. The program then asks the user to enter one of the two
strings ddmmyy or mmddyy .
5. The program displays the date it read in in the dd/mm/yyyy
format, if the user entered
ddmmyy in Step 4. Otherwise, it prints the date in the other
6. The program finally prints the message about the magic