Question: #%% Q2 ## ### ('Sun','Mon', 'Tue','Wed','Thu','Fri','Sat') # day-of-week-tuple # dowt = year = 2020 # cnt = 3 # 2020/1/1 is a Wednesday, so let

 #%% Q2 ## ### ('Sun','Mon', 'Tue','Wed','Thu','Fri','Sat') # day-of-week-tuple # dowt =

#%% Q2 ## ### ('Sun','Mon', 'Tue','Wed','Thu','Fri','Sat') # day-of-week-tuple # dowt = year = 2020 # cnt = 3 # 2020/1/1 is a Wednesday, so let us start a counting index of 3 for Wednesday, and keep adding one m = 3 # this will be a variable to be looped through eventually. I use the convention of 0-11 for the twelve months = m+1 # this is the month to be displayed/printed. The way it is set up now, it will NOT change automatically # month # when you change the value of m. Beware of that. # write a condition statement to determine the maxdays depending on the m value. # For example, when m=0 (Jan), maxdays should be 31, m=3 (Apr), maxdays should be 30, etc. # Try both ways, as a chunk of codes, or a one-liner maxdays = ????? print(maxdays) # Change your m value (between 0 and 11, inclusive) and run the chunk to see if prints out the correct result. 23 # Challenge: if you can take into account that year is multiple of 4, EXCEPT when year is multiple of 100, the days # in Feb should be 29. Otherwise, there should be 28. # Examples: 2004, 2008, 2012, Feb has 29 days, but 2001, 2002, 2003, 2005, 2006, # century marks, multiples of 100, they are non-leap years, so only 28 days. 28 days. Year 2000 or any

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