i am trying to make a code that print out calendar with some given months and years. My code look like this:
#!/usr/bin/python3
"""import calender"""
import calendar
import datetime
""" begin function """
def get_the_first_day_of_the_week(month, year):
day_of_week = datetime.date(year, month, 1).weekday()
return
def print_out_calender(months, years):
this_month = int(months)
this_year = int(years)
new = get_the_first_day_of_the_week(this_month, this_year)
new = int(new)
calendar.setfirstweekday(new)
calendar.monthcalendar(this_month, this_year)
return
print_out_calender(12, 2017)
i expect it to print out matrix of date but i got an error like this: Traceback (most recent call last):
File "./practice12.py", line 25, in <module>
print_out_calender(12, 2017)
File "./practice12.py", line 19, in print_out_calender
new = int(new)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
i am new to python and coding so can somebody tell me why?
return day_of_weekinside ofget_the_first_day_of_the_week?