SyntaxFix
Write A Post
Hire A Developer
Questions
One easy way to select random items is to shuffle then slice.
import random a = [1,2,3,4,5,6,7,8,9] random.shuffle(a) print a[:4] # prints 4 random variables