choices
리스트에서 랜덤으로 원소 뽑기 - python list random choices
import random selected = random.choice(someList) print(selected) 번외 확률을 가진 리스트에서 원소를 뽑는 방법이다. import random selected = random.choices( someList, # 원소 probabilityList # 원소의 확률 ).pop() print(selected)