Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

3642341780, 978-3642341786

More Books

Students also viewed these Databases questions