單項選擇題在Python中,哪個函數(shù)用于生成隨機數(shù)?()

A.rand()
B.random()
C.random.randint()
D.randomize()


您可能感興趣的試卷

你可能感興趣的試題

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

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

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

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

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

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

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

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都對