Question: Given data are stored in lists month _ name = [ January , Febrary, March, April, May, June, July, August, September, October,November, December
Given data are stored in lists
monthname January "Febrary", "March", "April", "May", "June",
"July", "August", "September", "October","November", "December"
monthday # Feb has days
extra
weekday Sun "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
# code here
# Define month names
monthname : "January", : 'February', : 'March', : 'April', : 'May', : 'June', : 'July', : 'August', :'September', : 'October', : 'November', : 'December'
# Define number of days in each month for nonleap year and leap year
nlymonthday
lymonthday
# Given Jan. falls on a Mon.
offseto
# Get year and month from user input
yyyy intinputPlease Enter the year you would like to print:
for mm in range:
# Calculate odd days
day yyyy
day day day day day
day day
# Calculate number of days in the month
if yyyy :
d sumlymonthday:mm
else:
d sumnlymonthday:mm
# Add odd days and offset to get starting day of the month
day d
day day
# Print month and year
printformatmonthnamemm yyyycenter
printSun Mon Tue Wed Thu Fri Sat"
# Print calendar for the month
if mm in :
daysinmonth
elif mm :
if yyyy :
daysinmonth
else:
daysinmonth
else:
daysinmonth
for i in range daysinmonth :
if i :
print day, end
if i :
print end
printi end
if i day:
print
else:
print en
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
