[Solved] Permanently remove an element from a list in Python?


Why not preselect your random celebrities, one per round?

import random

celebs = [
    "a", "b", "c", "d", "e", "f",
    "g", "h", "i", "j", "k", "l",
    "m", "n", "o", "p", "q", "r"    # need at least 15
]

chosen = random.sample(celebs, 15)
for round,celeb in enumerate(chosen, 1):
    print("{}: {}".format(round, celeb))

which gives

1: j
2: a
3: r
4: f
5: n
6: o
7: g
8: k
9: i
10: l
11: e
12: b
13: d
14: q
15: p

solved Permanently remove an element from a list in Python?