728x90 random.uniform()1 [Python Examples] Random 함수로 실수 구하기: #random.random(), #random.uniform() 파이썬에서 Random 함수를 통해서 랜덤 숫자를 산출하는데 float 단위(소수단위)의 숫자도 랜덤 함수를 통해 산출할 수 있다. 다른 말로는 실수를 구할 수 있다. #HOOAI import random x = random.random() print("Random float number 0.1 to 1: ", x) print("Random float number 0.1 to 1: ", random.random()) print("Random float number 0 to 1: ", random.uniform(0, 1)) print("Random float number 0 to 10: ", random.uniform(0, 10)) print("Random float number 10 to 100: ", .. 2021. 2. 2. 이전 1 다음 728x90