+ 4
How can I use list.reverse() in Python?
I've read that it can be used for switching elements' position in lists, but I don't know how it is used.
2 Answers
+ 2
Hello, please try this one:
some_list = [1, 2, 5, 10]
some_list.reverse()
print(some_list)
[10, 5, 2, 1]
+ 2
numbers = [1, 2, 3, 4, 5]
number.reverse()
print (numbers)