What are some of modules used in the code below? # Tuples list for each month along with their date ranges calendar = [('January', 31), ('Feburary', 28), ('March', 31), ('April', 30), ('May', 31), ('June', 30), ('July', 31), ('August', 31), ('September', 30), ('October', 31), ('November', 30), ('December', 31)] # Days of the week week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] def create_calendar(year, start_day): # Determines the current starting position on the calendar start_point = week.index(start_day) # If leap year occurs, Feburary date range changes to 29 if leap_year(year): calendar[1] = ('Feburary', 29) for month, days in calendar: print('{0} {1}'.format(month, year).center(25, ' ')) # Prints Month Titile print(' '.join(['{0:<3}'.format(w) for w in week])) # Prints Day Headings print('{0:<4}'.format('') * start_point, end='') # Adds spacing for non-zero starting point for day in range(1, days + 1): print('{0:<4}'.format(day), end='') # Prints day number start_point += 1 if start_point == 7: # If the starting point is sunday (7), start a new line print() start_point = 0 # Will reset counter print('\n') def leap_year(year): # Checks if a year is a leap year if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: return True else: return False else: return True else: return False year = int(input('Enter The Year: \n')) print() if year <= 0: # If number inputed is less than or equal to zero, creates 'Invalid Input' print('Invlid Input') import sys sys.exit() start_day = input('Enter Start Day Of The Year: Sun, Mon, Tue, Wed, Thu, Fri, Sat: \n',) print() create_calendar(year,start_day)
What are some of modules used in the code below? # Tuples list for each month along with their date ranges calendar = [('January', 31), ('Feburary', 28), ('March', 31), ('April', 30), ('May', 31), ('June', 30), ('July', 31), ('August', 31), ('September', 30), ('October', 31), ('November', 30), ('December', 31)] # Days of the week week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] def create_calendar(year, start_day): # Determines the current starting position on the calendar start_point = week.index(start_day) # If leap year occurs, Feburary date range changes to 29 if leap_year(year): calendar[1] = ('Feburary', 29) for month, days in calendar: print('{0} {1}'.format(month, year).center(25, ' ')) # Prints Month Titile print(' '.join(['{0:<3}'.format(w) for w in week])) # Prints Day Headings print('{0:<4}'.format('') * start_point, end='') # Adds spacing for non-zero starting point for day in range(1, days + 1): print('{0:<4}'.format(day), end='') # Prints day number start_point += 1 if start_point == 7: # If the starting point is sunday (7), start a new line print() start_point = 0 # Will reset counter print('\n') def leap_year(year): # Checks if a year is a leap year if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: return True else: return False else: return True else: return False year = int(input('Enter The Year: \n')) print() if year <= 0: # If number inputed is less than or equal to zero, creates 'Invalid Input' print('Invlid Input') import sys sys.exit() start_day = input('Enter Start Day Of The Year: Sun, Mon, Tue, Wed, Thu, Fri, Sat: \n',) print() create_calendar(year,start_day)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
What are some of modules used in the code below?
# Tuples list for each month along with their date ranges
calendar = [('January', 31), ('Feburary', 28), ('March', 31),
('April', 30), ('May', 31), ('June', 30),
('July', 31), ('August', 31), ('September', 30),
('October', 31), ('November', 30), ('December', 31)]
# Days of the week
week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
def create_calendar(year, start_day):
# Determines the current starting position on the calendar
start_point = week.index(start_day)
# If leap year occurs, Feburary date range changes to 29
if leap_year(year):
calendar[1] = ('Feburary', 29)
for month, days in calendar:
print('{0} {1}'.format(month, year).center(25, ' ')) # Prints Month Titile
print(' '.join(['{0:<3}'.format(w) for w in week])) # Prints Day Headings
print('{0:<4}'.format('') * start_point, end='') # Adds spacing for non-zero starting point
for day in range(1, days + 1):
print('{0:<4}'.format(day), end='') # Prints day number
start_point += 1
if start_point == 7: # If the starting point is sunday (7), start a new line
print()
start_point = 0 # Will reset counter
print('\n')
def leap_year(year):
# Checks if a year is a leap year
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
return True
else:
return False
else:
return True
else:
return False
year = int(input('Enter The Year: \n'))
print()
if year <= 0: # If number inputed is less than or equal to zero, creates 'Invalid Input'
print('Invlid Input')
import sys
sys.exit()
start_day = input('Enter Start Day Of The Year: Sun, Mon, Tue, Wed, Thu, Fri, Sat: \n',)
print()
create_calendar(year,start_day)
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY