Friday , September 20 2024

What is the expected result of the following code? import calendar calendar.setfirstweekday(calendar.SUNDAY) print(calendar.weekheader(3))

Questions BankCategory: Python Essentials 2What is the expected result of the following code? import calendar calendar.setfirstweekday(calendar.SUNDAY) print(calendar.weekheader(3))
What is the expected result of the following code?

import calendar
 
calendar.setfirstweekday(calendar.SUNDAY)
print(calendar.weekheader(3))
  • Sun Mon Tue Wed Thu Fri Sat
  • Su Mo Tu We Th Fr Sa
  • Tu
  • Tue

Explanation: The setfirstweekday() function is used to change the first day of the week to Sunday (from Monday as a default). The weekheader() function returns the weekday names in a shortened form, in this case to three characters.

More Questions: Python Essentials 2 (PE2) Course Final Test