Page 6 3 7 U Zoom Function Name Datecruncher Parameters Original Dates List Strings Return Q43866867
using python
Page < 6 3 of 7 U – ZOOM Function name: date_cruncher Parameters: original dates (list of strings) Return Type: list Description: Write a function that takes in a list of dates in “{month name} {date}, {year}” format, formats them into “{MM}-{DD}{YYYY}” format, and returns the list of formatted dates. In original_dates, the month could be the full month name OR a three-letter abbreviation of the month name (e.g., “October” vs. “Oct”). You should account for the month name having any type of capitalization. The date could be just a number (e.g.. “18”, “30”) or the ordinal number (e.g., “1st”, “2nd”, “3rd”, “4th”, etc.). You can assume the year will be 4 digits long. The formatted dates in the list returned should have the month and date both appear as two-digit integers. Test Cases: >>> original_dates = (“March 2nd, 2019”, “July 8th, 1997”, “September 19th, 4001”, “January 1st, 0001”] >>> date_cruncher (original_dates) [’03-02-2019′, ’07-08-1997′, ’09-19-4001′, ’01-01-0001’1 >>> original_dates = [“dEcEmBER 3, 2020”, “FEB 31st, 6000”, “apR 5, 1776”) >>> date_cruncher (original_dates) [’12-03-2020′, ’02-31-6000′, ’04-05-1776′) Show transcribed image text Page >> original_dates = (“March 2nd, 2019”, “July 8th, 1997”, “September 19th, 4001”, “January 1st, 0001”] >>> date_cruncher (original_dates) [’03-02-2019′, ’07-08-1997′, ’09-19-4001′, ’01-01-0001’1 >>> original_dates = [“dEcEmBER 3, 2020”, “FEB 31st, 6000”, “apR 5, 1776”) >>> date_cruncher (original_dates) [’12-03-2020′, ’02-31-6000′, ’04-05-1776′)
Expert Answer
Answer to Page < 6 3 of 7 U - ZOOM Function name: date_cruncher Parameters: original dates (list of strings) Return Type: list Des...
OR