# 1. convert calander year and month. your choice month or year , print
while True:
import calendar
year = int(input("Please input the year: "))
month = int(input("Please input the month (1-12): "))
cal = calendar.month(year, month)
with open(f"calendar_{year}_{month}.txt", "w") as file:
file.write(cal)
choice = input("do you want again see calendar : (y/n)")
if choice !="y":
break
print("calander is save!!!!!")
# 2. just convert calender in year means all months in year is print
while True:
import calendar
year = int(input("plaese enter a yaer : "))
cal = calendar.calendar(year)
with open(f"calendar_{year}.txt", "w") as file:
file.write(cal)
print(f"Calendar saved as calendar_{year}.txt")
print("calander is save !!!!")
choice = input("Do You Want Again Use Calander : (y/n)")
if choice !="y":
break
No comments:
Post a Comment