jeudi 24 septembre 2015

Randomizing a list of tuples without random.shuffle() python

I have a list of tuples looking like... deck=[(1,'clubs'),(1,'hearts')...and so on to (13,'diamonds').

How do I randomize this list into something like...

[(5,'spades'),(12,'clubs'),(3,'clubs'),... and so on?

I have tried using random.randint() and nothing seems to work. And I can not use random.shuffle()




Aucun commentaire:

Enregistrer un commentaire