loading...

Display calendar with python

github logo ・1 min read

Python has a built-in function, 'calendar' to work with date related tasks.
You will learn to display the calendar of a given date with below example.


import calendar

yy = 2018
mm = 8

print(calendar.month(yy, mm))

In the program top, we import the calendar module. The built-in function month() inside the module takes in the year and the month and displays the calendar for that month of the year.

Output:

    August 2018
Mo Tu We Th Fr Sa Su
       1  2  3  4  5
 6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
twitter logo DISCUSS
Classic DEV Post from Sep 2 '17

How I learned Go Programming

How I got started with the Go Programming language

Hasan Sajedi profile image
https://ir.linkedin.com/in/hassan-sajedi-1a2a3158

Tip: You can configure your dev.to reading experience, such as using sans serif fonts.

Go to your the "misc." section of your settings.

Customize dev.to