from random import *
print(random()) #0.0 이상 1.0 미만의 임의의 값 무작위 생성
print(random() * 10) #0.0이상 10.0 미만의 임의의 값 생성
print(int(random() * 10)) # 0이상 10 미만의 임의의 값 생성
print(int(random() * 10) + 1) #1이상 10이하의 임의의 값 생성
#로또 번호 뽑기
print(int(random() * 45) + 1) #1이상 45이하의 임의의 값 생성
print(randrange(1,46)) #1이상 46미만의 임의의 값 생성
print(randint(1,45)) #1이상 45이하의 임의의 값 생성
반응형