Python-生成必定範圍的隨機小數

 代碼以下: #Python-生成必定範圍的隨機小數 import random A=0 B=1#小數的範圍A ~ B a=random.uniform(A,B) C=2#隨機數的精度round(數值,精度) print(round(a,C)) 結果以下:
相關文章
相關標籤/搜索