In this tutorial, we will introduce a most simplest method to reverse python list, you can learn and do by our example code.
Meanwhile, if you want to reverse python string, you can read this tutorial.
How to reverse python list?
We can use list[::-1] to reverse.
list = [1,2,3,4,5] list = list[::-1] print(list)
The output is:
[5, 4, 3, 2, 1]