Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago