from random import randint
k=[]
for i in range(10):
k.append(randint(1,5))
k.sort()
print(k)
The output will be correct but sometimes it not include value from 1 to 5. for example, maybe k=[2,3,3,3,3,4,4,5,5,5] and not included 1. I need to include all numbers