You can use random.sample Try this:
random.sample
import random mylist = ['a','b','c','d'] print(random.sample(mylist, 2))
2.1m questions
2.1m answers
60 comments
57.0k users