Question: Make a calendar for a given year (12 months calendar) from this code: # use list or tuple for the given data month_name = {1:

Make a calendar for a given year (12 months calendar) from this code:

# use list or tuple for the given data month_name = {1:'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', nly_month_day

 

# use list or tuple for the given data month_name = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', nly_month_day = 7: 'July', 8: 'August', 9: 'September', 10:'October', 11: 'November', 12: 'December'} [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] ly_month_day = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # Given 2000 Jan. 1 falls on a Sat. offset_0 = 6 # Code here yyyy = int(input("Please Enter the year you would like to print(yyyy): ")) mm = int (input("Please Enter the month you would like to print(mm): ")) # To calculate odd days day =(yyyy - 1) % 400 day = (day//100) * 5 + ((day % 100) - (day % 100)//4) + ((day % 100)//4) * 2 day day % 7 = d = 0 if yyyy % 4 == 0: else: for i in range(mm - 1): d+= ly_month_day[i] for i in range(mm-1): d+= nly_month_day[i] day += d % 7 day day % 7 S="I print(s.rjust (6, '), month_name [mm], yyyy) print( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') if mm == 4 or mm == 6 or mm == 9 or mm == 11: for i in range(31 + day): if i

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 Programming Questions!