-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalender.py
More file actions
38 lines (22 loc) · 835 Bytes
/
Copy pathcalender.py
File metadata and controls
38 lines (22 loc) · 835 Bytes
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
32
33
34
35
36
37
38
'''
let's write a program print calender of a given month, year and day
we will have import calender library
this library .or module includes several function we take a look at few of them
'''
#import calender module
import calendar
date = input("enter the date(dd/mm/year): ")
day, month, year = date.split("/")
day = int(day)
month = int(month)
year = int(year)
#print("calender of month ", month, " of year ", year)
print(calendar.month(year, month))
print("month length: ", calendar.monthlen(year, month))
print("next month: ", calendar.nextmonth(year, month))
print("previous month: ", calendar.prevmonth(year, month))
print("week day(week start from monday):", calendar.weekday(year, month, day))
'''
let's have a look at few more basic functions
thank you for watching
'''