Reversed
Learn how to reverse sequences with the help of the "reverse" function.
We'll cover the following...
reversed function
reversed is a useful function. It returns an iterator that reverses the order of the elements in the original sequence. For example:
Press + to interact
Python 3.8
a = [2, 4, 6, 8]r = reversed(a)print(list(r))
Here, r is an iterator that accesses the elements of a in reverse order. When we create ...
Ask