- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalander.py
More file actions
Latest commit
22 lines (17 loc) · 615 Bytes
/
Copy pathCalander.py
File metadata and controls
22 lines (17 loc) · 615 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
importcalendar
defdisplay_calendar(year, month):
cal=calendar.monthcalendar(year, month)
month_name=calendar.month_name[month]
print(f"\nCalendar for {month_name}{year}\n")
print("Mo Tu We Th Fr Sa Su")
forweekincal:
fordayinweek:
ifday==0:
print(" ", end=" ")
else:
print(f"{day:2} ", end="|")
print()
if__name__=="__main__":
year_input=int(input("Enter the year (e.g., 2024): "))
month_input=int(input("Enter the month (1-12): "))
display_calendar(year_input, month_input)