+ 2

What's the error

import calendar #specify the month and year year = 2024 month = 7 #create a text calendar cal = calendar.textcalendar(calendar.SUNDAY) #print the formate calendar_text = cal.formatyear(year,month) print(calendar_text)

27th Jul 2024, 6:53 PM
Rahul Bankar
Rahul Bankar - avatar
4 Answers
+ 2
Read the error message CAREFULLY. there is no textcalendar method. check the spelling of the method
27th Jul 2024, 7:37 PM
Lisa
Lisa - avatar
0
Tip: The method in question requires PascalCase
27th Jul 2024, 8:25 PM
Chris Coder
Chris Coder - avatar
0
Rahul Bankar if you only want to print the month, use prmonth. You don't have to use print with prmonth. It prints the result by default. https://sololearn.com/compiler-playground/cc4z2lyOaVto/?ref=app
28th Jul 2024, 3:10 AM
Bob_Li
Bob_Li - avatar