Using the mylist[::-1]
syntax, as asked, reverses a list. It does NOT shuffle the list.
Negative values also work to make a copy of the same list in reverse
order:
>>> L[::-1]
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
solved Shuffling a list in python
Using the mylist[::-1]
syntax, as asked, reverses a list. It does NOT shuffle the list.
Negative values also work to make a copy of the same list in reverse
order:
>>> L[::-1]
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
solved Shuffling a list in python