Q302. random 모듈을 이용하여 리스트, 튜플, 문자열의 요소 중 임의의 요소 값을 반환하는 프로그램을 완성하시오. (500점)
import random
print('choice([1, 2, 3, 4, 5, 6]) :', random._______([1, 2, 3, 4, 5, 6]))
print('choice('python') :', random._______('python'))
- 난이도(1~10) : 5
- 힌트 :
- - 실행 결과
-
choice([1, 2, 3, 4, 5, 6]) : 1
choice('python') : t
import random
print('choice([1, 2, 3, 4, 5, 6]) :', random.choice([1, 2, 3, 4, 5, 6]))
print('choice('python') :', random.choice('python'))