Question: PYTHON PLEASE Your ship crashes and you wake up alone on a deserted island. You realize that you lost your calender in the wreck, and

PYTHON PLEASE

PYTHON PLEASE Your ship crashes and you wake up alone on a

Your ship crashes and you wake up alone on a deserted island. You realize that you lost your calender in the wreck, and now face the extremely pressing issue of losing track of the date. Luckily, you remember today's date. Even more luckily, you stumble upon a working computer on the island. You think back to your CSE 101 class, and realize that you can write a Python function that calculates tomorrow's date. If you call this function every day, you can completely solve this problem! Complete the function tomorrows_date, which returns a string containing tomorrow's date. Assume that there are 12 months in a year, and 30 days in each month. Also, assume leap years don't exist (ideally, you wouldn't be stuck on the island until the next one, anyway). The function's input is of the format 'MM/DD/YYYY', where each letter corresponds to one digit. The output will be of the same format, but leading zeroes don't matter. For example, '01/01/2021' is just as correct as '1/1/2021' or even '01/1/2021'. First, separate the month, day, and year into three variables. Then, follow this logic: if month is 12 and day is 30: # so we advance the month, day, and year next day is '1/1/(year + 1)' elif day is 30: # therefore the month is NOT 12, so we advance the month and day next day is '(month + 1)/1/(year) else: + we advance only the day next day is '(month)/(day + 1)/(year)' Examples: Function Call Return value tomorrows date(' 12/30/1999') tomorrows_date('01/30/1996') tomorrows_date('11/20/2021') '1/1/2000 or 01/01/2000 2/1/1996' or '02/01/1996 '11/21/2021' U def tomorrows_date(today): pass # delete this line and start writing your code here # Test cases print (tomorrows_date(' 12/30/1999' ) ) print(tomorrows_date('01/30/1996' )) print(tomorrows_date('11/20/2021'))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!