from random import shuffle lst = [randint(0,50) for _ in range(100)] shuffle(lst) print(lst[:5]) # [50, 3, 48, 1, 26]