# Arup Guha
# 10/13/2020
# Basic Function Example - idea of function main
# Taking idea from P5 - printing just one month.

def main():

    months = int(input("How many months do you want to print?\n"))

    # Go to each month.
    for month in range(1,months+1):

        # Month header.
        print("Month",month)

        # Prints one month! Calling the one month function
        oneMonth()

        # Blank line after each month.
        print()

def oneMonth():

    # Get # of days in a month
    days = int(input("How many days in a month?\n"))

    # Header for calendar.
    print("S\tM\tT\tW\tR\tF\tS")

    # Loop through days.
    for day in range(1,days+1):

        # Safe to print the day with a tab.
        print(day,end="\t")

        # If we're at the end of the week, go to a new line.
        if day%7 == 0:
            print()

# Run it!
main()

