Question: this is a python question for intro/medium level. please not include any high level technique thanks! Strings Function name: date_cruncher Parameters: original_dates (list of strings)

this is a python question for intro/medium level. please not include any "high level technique" thanks!
this is a python question for intro/medium level. please not include any

Strings 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']

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!