Q. Write a program that reads a date as an integers in the format MMDDYYYY. The program will call a function that prints print out the date in the format <month name > <day>,<year>.


You can understand by Watching video :-



Answer :-

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

a = int (input("Enter the date  = " ))

month = a // 1000000
date = (a % 1000000) // 10000
year = a % 10000

print ( mon [ month - 1 ] , date ,", ", year )

Output :-

Enter the date  = 12252019
December 25  ,  2019

>>>

Enter the date  = 09162021
September 16  ,  2021

>>> 

Enter the date  = 11302020
November 30  ,  2020

>>>


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post