

MCQOPTIONS
Saved Bookmarks
This section includes 5 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.
1. |
State whether true or false. |
A. | True |
B. | FalseView Answer |
Answer» C. | |
2. |
What will be the output if we try to extract only the year from the following Python code? (time.struct_time(tm_year=2017, tm_mon=6, tm_mday=25, tm_hour=18, tm_min=26, tm_sec=6, tm_wday=6, tm_yday=176, tm_isdst=0)) |
A. | t[1] |
B. | tm_year |
C. | t[0] |
D. | t_yearView Answer |
Answer» D. t_yearView Answer | |
3. |
The sleep function (under the time module) is used to ___________ |
A. | Pause the code for the specified number of seconds |
B. | Return the specified number of seconds, in terms of milliseconds |
C. | Stop the execution of the code |
D. | Return the output of the code had it been executed earlier by the specified number of seconds |
E. | is used to ___________a) Pause the code for the specified number of secondsb) Return the specified number of seconds, in terms of millisecondsc) Stop the execution of the coded) Return the output of the code had it been executed earlier by the specified number of seconds |
Answer» B. Return the specified number of seconds, in terms of milliseconds | |
4. |
Which of the following functions can be used to find the coordinated universal time, assuming that the datetime module has already been imported? |
A. | datetime.utc() |
B. | datetime.datetime.utc() |
C. | datetime.utcnow() |
D. | datetime.datetime.utcnow() |
Answer» E. | |
5. |
The output of both of the print statements is the same. |
A. | True |
B. | FalseView Answer |
Answer» C. | |