Format 1
Format 1
The
number of days in July 2025C. A string representation of July 2025D. The weekday
July 2025 starts onAnswer: A, B, D
Which statements about calendar.monthrange(year, month) are true?A. The first value
is between 0 and 6B. The second value is always 30 or 31C. The first value
represents the weekday the month starts onD. The second value represents the number
of days in the monthAnswer: A, C, D
What does calendar.prcal(2025) do?A. Prints a calendar for 2025 to the consoleB.
Returns a list of all days in 2025C. Sets the first weekday to SundayD. Calculates
leap days in 2025Answer: A
How many days does February 2025 have?A. 28B. 29C. 30D. 31Answer: C
What is the output of calendar.monthrange(2024, 2)?A. (5, 28)B. (5, 29)C. (6, 28)D.
(6, 29)Answer: B
What does calendar.prmonth(2025, 6) do?A. Prints the year calendarB. Prints the
month calendarC. Returns the month calendar as a stringD. Converts the month
calendar to HTMLAnswer: B
What does calendar.setfirstweekday modify?A. The year calendarB. The format of the
dateC. The start of the week in the calendar displayD. The number of days in a
monthAnswer: C
What does the function calendar.prmonth(year, month, w=0, l=0) do?A) Prints the
year calendarB) Prints the month calendarC) Returns the month calendar as a string
D) Converts the month calendar to HTMLAnswer: B
How do you call calendar.prmonth() to print the calendar for May 2024?A)
calendar.prmonth(2024, 5)B) calendar.prmonth(5, 2024)C) calendar.prmonth(2024)D)
calendar.prmonth(5)Answer: A
How does calendar.prmonth() handle months with less than 7 days?A) It prints a
blank monthB) It adjusts the display automaticallyC) It will not print the monthD)
It throws an errorAnswer: B
Can calendar.prmonth() print a calendar for a month in the future, like May 2030?A)
Yes, it can print any month in the futureB) No, it only works for current or past
monthsC) Yes, but it will print errors for future monthsD) No, it throws an error
Answer: A
What happens if you pass calendar.prmonth(2024, 2, w=10)?A) The calendar will not
print correctly because w cannot be greater than 6B) It prints the month, but w
will have no effectC) It will print the month calendar with increased widthD) It
will throw an errorAnswer: C
What does calendar.setfirstweekday(1) do?A) It sets Sunday as the first day of the
weekB) It sets Monday as the first day of the weekC) It throws an errorD) It has no
effectAnswer: B
What is the correct syntax to print a calendar for December 2025 using
calendar.prmonth()?A) calendar.prmonth(2025, 12)B) calendar.prmonth(12, 2025)C)
calendar.prmonth(2025)D) calendar.prmonth(12)Answer: A
What will calendar.monthrange(2024, 2) return?A) (3, 29)B) (3, 28)C) (3, 30)D) (3,
29)Answer: A
How do you get a matrix representation of a month using the calendar module?A)
calendar.matrix(2024, 4)B) calendar.monthcalendar(2024, 4)C) calendar.grid(2024, 4)
D) calendar.array(2024, 4)Answer: B
What is the output of calendar.weekheader(3)?A) 'Sun Mon Tue Wed Thu Fri Sat'B) 'Su
Mo Tu We Th Fr Sa'C) 'Sun Mo Tue Wed Thu Fri Sat'D) 'Sun Tue Thu Sat Mon Wed Fri'
Answer: B
What will time.gmtime(0) return?A) The current UTC timeB) The struct_time for the
Unix epoch (January 1, 1970, 00:00:00 UTC)C) A timestamp in secondsD) NoneAnswer: B
What does time.sleep(3) do?A) Pauses execution for 3 secondsB) Returns the time
after 3 secondsC) Returns the system’s uptimeD) Converts 3 seconds into a timestamp
Answer: A
What is the default argument for time.localtime()?A) time.time()B) 0C) NoneD) "now"
Answer: A
How do you get the number of seconds since the Unix epoch?A) time.unix_seconds()B)
time.timestamp()C) time.time()D) time.epoch_seconds()Answer: C