'Inspiration 1 – 신청 희망자 사전 점검'에 답변달기

#11710
Taewon Joh
import numpy as ny

l = []
for i in range(1,21):
    r = ny.random.randint(1,11)
    l.append(r)

print("list :{}".format(l))

j = 0
for i in l:
    if 1<= i <= 3:
        print("low {}".format(i))
    elif 4<= i <=6:
        print("medium {}".format(i))
    else:
        print("high {}".format(i))

(venv) [email protected] BasicProject01 % python main.py
list :[1, 4, 7, 6, 3, 7, 9, 4, 6, 1, 3, 10, 6, 6, 9, 5, 9, 9, 9, 10]
low 1
medium 4
high 7
medium 6
low 3
high 7
high 9
medium 4
medium 6
low 1
low 3
high 10
medium 6
medium 6
high 9
medium 5
high 9
high 9
high 9
high 10