Question: PROBLEM 8 Frequently data contains mixed formats for dates and times. Here you will create a program to handle mixed formats for dats. Write a

PROBLEM 8 Frequently data contains mixed formats
PROBLEM 8 Frequently data contains mixed formats
PROBLEM 8 Frequently data contains mixed formats for dates and times. Here you will create a program to handle mixed formats for dats. Write a function that takes a list of two dates in format of MM-DD-YYYY or MMDDYYYY as input, and returns a list containing the number of years, months, weeks and days between the two as outputs. The two dates will be formatted as a list. Using two functions will help with the two formats. This code should handle invalid dates by printing 'ERROR, Invalid date. It is recommended that you use the datetime package from Python. NOTE: for the purpose of this exercise you may consider months equal to 30.5 days, or you may consider the value specific to each month. NOTE: full credit will be awarded if the years, months and weeks are correct. Th1211 moet datetime Valid dates: In 1 11 dates - 09-03-1903.06-01-1945 1 daten2 = 108161369,03-04-2012 1 data-02-29-2000.12-13-2017) ditent-T08-01-1996 11242661 ditem-197-05-2010 07042060) Functions to pro Invalid dates: In [ ]: dates 6 - ['10321984'10-30-1984'1 dates7 - (08-17-1916 13-05-1976) dates = ['02-30-199705-01-2018) In [ ]: det reformatd): ENTER YOUR CODE BELOW In 1 1: def convertDates (dates) FANTER YOUR CODE BELOW

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 General Management Questions!