Question

**PLEASE DO THIS IN PYTHON** The date February 9th, 2018, is a magic date because when...

**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.

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The date February 9th, 2018, is a magic date because when we write it in the...
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/9/18 Write a script (Python) 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...
Write a Python program that reads in the month, day, and year of a date and...
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...
February 18 is a special date for the CCC this year. Write a program that asks...
February 18 is a special date for the CCC this year. Write a program that asks the user for a numerical month and numerical day of the month and then determines whether that date occurs before, after, or on February 18. If the date occurs before February 18, output the word Before. If the date occurs after February 18, output the word After. If the date is February 18, output the word Special. Input The input consists of two integers...
Modify the Date class in Fig. 8.7 by adding a new method called nextDay() that increments...
Modify the Date class in Fig. 8.7 by adding a new method called nextDay() that increments the Date by 1 when called and returns a new Date object. This method should properly increment the Date across Month boundary (i.e from the last day of the month to the first day of the next month). Write a program called DateTest that asks the user to enter 3 numbers (one at a time) corresponding to Month, Day and Year. The first two...
Decisions, decisions, decisions. Computers are terrible at them, so as programmers we need to instruct them...
Decisions, decisions, decisions. Computers are terrible at them, so as programmers we need to instruct them on how to make good ones. In this lab you will write a program that accepts a date in the form “month/day/year” and prints whether or not the date is valid. For example 5/24/1962 is valid, but 9/31/2000 is not. (September has only 30 days.) Your program, in order to be correct, should be able to pass these simple (but far from complete!) test...
PYTHON : Create a Email Address Parser (* Please do make comments*) Often times, you may...
PYTHON : Create a Email Address Parser (* Please do make comments*) Often times, you may be given a list of raw email addresses and be asked to generate meaningful information from such a list. This project involves parsing such a list and generating names and summary information from that list. The script, eparser.py, should: Open the file specified as the first argument to the script (see below) Read the file one line at a time (i.e., for line in...
Please do the following in python: Write a program (twitter_sort.py) that merges and sorts two twitter...
Please do the following in python: Write a program (twitter_sort.py) that merges and sorts two twitter feeds. At a high level, your program is going to perform the following: Read in two files containing twitter feeds. Merge the twitter feeds in reverse chronological order (most recent first). Write the merged feeds to an output file. Provide some basic summary information about the files. The names of the files will be passed in to your program via command line arguments. Use...
Python #Imagine you're writing a program to check if a person is #available at a certain...
Python #Imagine you're writing a program to check if a person is #available at a certain time. # #To do this, you want to write a function called #check_availability. check_availability will have two #parameters: a list of instances of the Meeting class, and #proposed_time, a particular date and time. # #check_availability should return True (meaning the person #is available) if there are no instances of Meeting that #conflict with the proposed_time. In other words, it should #return False if proposed_time...
Write a Python program named lastNameVolumes that finds the volumes of different 3 D objects such...
Write a Python program named lastNameVolumes that finds the volumes of different 3 D objects such as a cube, sphere, cylinder and cone. In this file there should be four methods defined. Write a method named cubeVolFirstName, which accepts the side of a cube in inches as an argument into the function. The method should calculate the volume of a cube in cubic inches and return the volume. The formula for calculating the volume of a cube is given below....
Do it in python please Boston Americans 1903 No Winner 1904 New York Giants 1905 Chicago...
Do it in python please Boston Americans 1903 No Winner 1904 New York Giants 1905 Chicago White Sox 1906 Chicago Cubs 1907 Chicago Cubs 1908 Pittsburgh Pirates 1909 Philadelphia Athletics 1910 Philadelphia Athletics 1911 Boston Red Sox 1912 Philadelphia Athletics 1913 Boston Braves 1914 Boston Red Sox 1915 Boston Red Sox 1916 Chicago White Sox 1917 Boston Red Sox 1918 Cincinnati Reds 1919 Cleveland Indians 1920 New York Giants 1921 New York Giants 1922 New York Yankees 1923 Washington Senators...