Question: In python: It is sometimes useful to know which day of the year a particular date is. For example Jan.1 is day 1, Jan. 31

In python:In python: It is sometimes useful to know which day of the

It is sometimes useful to know which day of the year a particular date is. For example Jan.1 is day 1, Jan. 31 is day 31, Feb 1 is day 32 (31+1), and March 1 is day 60 (31+28+1). For this problem we will ignore leap years. Ask the user to enter the date in the form mm/dd/yy. So Feb 7 is 02/07/20. Your task is the compute which day of the year that is. Make use of the list months=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]. Use a loop to add up some of the values in this list. You will have to use a string function to isolate the month and the day, which you will need for your calculation. Sample output: Please enter the date as mm/dd/yy 03/20/17 03/20/17 is day 79 of the year

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!