reversed()

Built-in FunctionPython 2.4+Beginner

Returns a reverse iterator over a sequence

Quick Info

Documentation
Official Docs
Python Version
2.4+

Learn by Difficulty

Quick Example

python
print(list(reversed([1, 2, 3, 4, 5])))
print(list(reversed("hello")))
print(list(reversed(range(5))))

reversed() is a built-in function that returns a reverse iterator over a sequence.

Try in Playground

Tags

builtinfunctioncoreiterationsequence

Related Items