Explore topic-wise MCQs in Python.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.

1.

What will be the output of the following Python code if the system date is: 6/19/2017

A. 2017-16-19
B. 2017-06-9
C. 2017-06-29
D. ErrorView Answer
Answer» D. ErrorView Answer
2.

Which of the following will throw an error if used after the following Python code?

A. print(t_day.seconds)
B. print(t_day.months)
C. print(t_day.max)
D. print(t_day.resolution)View Answer
Answer» C. print(t_day.max)
3.

The value returned when we use the function isoweekday() is ______ and that for the function weekday() is ________ if the system date is 19th June, 2017 (Monday).

A. 0,0
B. 0,1
C. 1,0
D. 1,1
Answer» D. 1,1
4.

Point out the error (if any) in the code shown below if the system date is 18th June, 2017?

A. 3 months, 0:00:00
B. 90 days, 0:00:00
C. 3 months 2 days, 0:00:00
D. 92 days, 0:00:00View Answer
Answer» E.
5.

What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)?

A. Wed
B. Wednesday
C. 2
D. 3View Answer
Answer» E.
6.

What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?

A. 18-06-2017
B. 06-18-2017
C. 2017-06-18
D. ErrorView Answer
Answer» D. ErrorView Answer
7.

What will be the output of the following Python code if the system date is 18th August, 2016?

A. August
B. Aug
C. 08
D. 8View Answer
Answer» E.