單項選擇題在Python中,哪個模塊用于測量代碼片段的執(zhí)行時間?()

A.time
B.datetime
C.stopwatch
D.timeit


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在Python中,如何將多個字典合并成一個字典?()

A.dict1+dict2
B.dict1.update(dict2)
C.{**dict1,**dict2}
D.B和C都對

2.多項選擇題在Python中,如何將一個列表排序?()

A.list.sort()
B.sort(list)
C.list.sorted()
D.sorted(list)

3.單項選擇題在Python中,如何獲取當前時間?()

A.import datetime;datetime.datetime.now()
B.time.now()
C.datetime.now()
D.A和B都對

4.單項選擇題在Python中,如何創(chuàng)建一個列表推導式?()

A.[x for x in range(10)]
B.list(x for x in range(10))
C.for x in range(10):list.append(x)
D.A和B都對

5.單項選擇題在Python中,如何使用“in”操作符?()

A.x in list
B.list.contains(x)
C.list.has(x)
D.A和B都對