User Tools

Site Tools


clubs:python_club:python_club_ex_display_calendar
Home | clubs :: cloud club :: python_club :: 3D-Printing | projects :: Proxmox | Kubernetes | scripting | utilities | games

About the Club

Python Club Topics - Exercise: Display calendar

Exercise: Display a calendar month

  1. Output: Display the calendar month for the given month and year
  2. What you learn from the example:
    1. Importing and using library modules
    2. Using the calendar module
    3. Passing arguments to modules
    4. Take input from the user

Solution

[1] code:python show
# Program to display calendar of the given month and year

# importing calendar module
import calendar

# To take month and year input from the user
yy = int(input('Enter year: '))
mm = int(input('Enter month: '))

# display the calendar
print(calendar.month(yy, mm))
clubs/python_club/python_club_ex_display_calendar.txt · Last modified: by 127.0.0.1