Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that reads a string from the user containing a date in the forma

ID: 3770294 • Letter: W

Question

Write a program that reads a string from the user containing a date in the format ( mm/dd/yyyy. ) You program should print the date in the form: November 17,2011.

Additional Program requirements:

You are to define and use a list of month names to convert month number input to string name. i.e.

month_list = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

I recommend that you use the split method on the input date string to create a list of numbers between / marks. i.e.  

#split date_string

date_list = date_string.split("/")

Please use this with python and type the layout as if you were editing with idle on python

Explanation / Answer

month_list = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
date_string = str(input())
date_list = date_string.split("/")
print month_list[int(date_list[0])-1],
print " "+date_list[1]+",",
print date_list[2]

--------------------------------------------

Input : "11/17/2011"

output : November 17, 2011

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote