Question: Python def reformat_date(date): return None if __name__ == '__main__' : print( 'Testing reformat_date() for 5/17/2021: ' + str(reformat_date( '5/17/2021' ))) print( 'Testing reformat_date() for 12/31/2000:

Python Python def reformat_date(date): return None if __name__ == '__main__': print('Testing reformat_date() for def reformat_date(date): return None 

if __name__ == '__main__': 
 print('Testing reformat_date() for 5/17/2021: ' + str(reformat_date('5/17/2021'))) print('Testing reformat_date() for 12/31/2000: ' + str(reformat_date('12/31/2000'))) print('Testing reformat_date() for 9/8/2017: ' + str(reformat_date('9/8/2017'))) print('Testing reformat_date() for 8/5/2003: ' + str(reformat_date('8/5/2003'))) 

Write a function reformat-date that takes a string argument containing a date in one format it and returns the date in another format. Specifically, it converts an argument like 10/31 2017' (MM/DD/YYYY) to 31-OCT-17' (DD-MMM-YY). The three-letter abbreviations in the return value must be given in all capital letters: JAN, FEB, MAR, APR, MAY, JUN, Nov, DEC. (Hint: don't need if statements to map month numbers to these strings. Try to think of another way. The returned day and year must be given as two-digit values, even if the first digit is a 0. The argument will not include leading zeroes. You may assume that the year is in the range 2000-2999, inclusive. Examples: Function Call Return Value reformat date 5/17/2021') 17-MAY-21' reformat date 12/31/2000') 31-DEC-00 reformat date 9/8/2017') 08-SEP-17' reformat date 8/5/2003') 05-AUG-03' Note that the quotation marks displayed in the examples are there to emphasize that the argument and return value are strings. You should not add quotation marks to your return values

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!