Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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 yearStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started