Question: Complete the code to implement the following operations: Complete read _ date ( ) : Read an input string representing a date in the format
Complete the code to implement the following operations:
Complete readdate:
Read an input string representing a date in the format yyyymmddCreate a date object from the input string.Return the date object.
Call readdate four times to read four unique date objects and store the date objects in a list.
Call sorted to sort the list of date objects, earliest first. Store the sorted dates in a new list.
Output the sorteddates, in the format mmddyyyy
Hint: Use strftime to format the date outputs. See resource below.
Output the number of days between the last two dates in the sorted list as a positive number.
Output the date that is weeks from the most recent date in the format "July
Hint: Use timedelta to set a duration of time for the arithmetic on date objects. See resources below.
Ex: timedeltadays seconds hours weeks will define a duration of days seconds hours weeks.
Output the full name of the day of the week of the earliest day
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
