單項選擇題在Python中,如何生成一個0到1之間的隨機(jī)浮點數(shù)?()

A.random.random()
B.random.uniform(0,1)
C.random.randint(0,1)
D.A和B都對


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在Python中,如何拋出自定義異常?()

A.raise MyException("message")
B.throw MyException("message")
C.exception MyException("message")
D.new Exception("message")

2.單項選擇題在Python中,如何實現(xiàn)多線程?()

A.import threading
B.from concurrent.futures import ThreadPoolExecutor
C.from multiprocessing import Process
D.A和B都對

3.單項選擇題在Python中,如何檢查一個變量是否存在?()

A.if ’var’in locals()
B.if var
C.if exists(var)
D.if ’var’in globals()

4.單項選擇題在Python中,如何創(chuàng)建一個空集合?()

A.set ={}
B.set =set()
C.set =[]
D.set =()

5.單項選擇題在Python中,如何將一個列表轉(zhuǎn)換成字符串?()

A.’’.join(list)
B.str(list)
C.list.toString()
D.list.str()