What will be the output of the following Python code? [code]import time t=(2010, 9, 20, 8, 15, 12, 6) time.asctime(t)[/code]

Kim Trang

New member
What will be the output of the following Python code?
Code:
import time
t=(2010, 9, 20, 8, 15, 12, 6)
time.asctime(t)
A. ‘20 Sep 2010 8:15:12 Sun’
B. ‘2010 20 Sept 08:15:12 Sun’
C. ‘Sun Sept 20 8:15:12 2010’
D. Error
 
Answer: d
Explanation: The code shown above results in an error because this function accepts exactly 9 arguments (including day of the year and DST), but only 7 are given. Hence an error is thrown.
 

Tìm kiếm

Back
Top