- random( ) : 0.0 ~ 1.0미만의 임의의 값 생성
- random( ) * 10 : 0.0 ~ 10.0미만의 임의의 값 생성
- int(random( ) * 10) : 0 ~ 10미만의 임의의 정수값 생성
- int(random( ) * 10) + 1 : 1 ~ 10이하의 임의의 정수값 생성
- irandrange(a, b) : a ~ b미만의 임의의 정수값 생성
- randint(a, b) : a ~ b이하의 임의의 정수값 생성
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이하의 임의의 정수값 생성
-출처-