3

This is my list:

biglist = [ {'title':'U2','link':'u2.com'}, {'title':'beatles','link':'beatles.com'} ]
print random.shuffle(biglist)

that doesn't work! It returns none.

TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
  • Related/dupe: [Why does `random.shuffle` return None?](https://stackoverflow.com/questions/17649875/why-does-random-shuffle-return-none) – Aran-Fey Jun 14 '18 at 17:42

1 Answers1

16

random.shuffle shuffles the list, it does not return a new list. So check biglist, not the result of random.shuffle.

Documentation for the random module: http://docs.python.org/library/random.html

Blixt
  • 49,547
  • 13
  • 120
  • 153