def randomize(data): newdata = [] while data: index = randint(0, len(data)-1) yield data.pop(index)