Question: 2. Write a function that accepts 0 arguments. Inside the function, ask the user for the day of the month. Remember that you can use
2. Write a function that accepts 0 arguments. Inside the function, ask the user for the day of the month. Remember that you can use the input() function to do this. Then ask the user for the day of the week. Your function should print a format string that outputs what the day of the week and the day of the month will be tomorrow So if the user says today is Monday and the day of the month is the 22, then your function should output: 'Tomorrow is Tuesday the 23.' (Note that there is a period at the end of the sentence). You should use a format string to create your string that gets output. As with the previous problem, your function should NOT care if the user types "Tuesday' or 'tuesday', or 'TUESDAY', or "UESday', etc. As with the previous problem, the easiest way to do this is to convert whatever the user types to lower case. Note that if the day of the month is the 31, then the date for tomorrow should be 1. (To keep this problem from getting too complicated, we will pretend that all months have 31 days). For example: print TomorrowDate() What is the day of the month? 31 What is the day of the week? SUNDAY Tomorrow is Monday, the 1. print TomorrowDate() What is the day of the month? 28 What is the day of the week? thURSday Tomorrow is Friday, the 29. Hints: Remember that the input() function returns a string. For the day of the month, you will need to convert the string to an integer . You wil need a series of if/elif statements to convert the day of the week. For the day of the month, however, you can simply add one-though only after making sure it is not the 31
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
