Write a program that reads a string from the user containing a date in the format mm/dd/yyyy. It should print the date in the format April 25, 2020. You may assume the date entered is valid and that there is always exactly 2 digits for month and day.

Respuesta :

The program illustrates the use of list slicing

The program in Python where comments are used to explain each line is as follows:

#This initializes all months

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

#This gets input for date

ddate = input("Date: ")

#This extracts the month from the input date

month = monthList[int(ddate[0:2]) - 1]

#This prints the date in the required format

print(month+" "+ddate[3:5]+", "+ddate[6:10])

Read more about list slicing at:

https://brainly.com/question/16397886

ACCESS MORE