reversed()Easy Examples

Returns a reverse iterator over a sequence

Basic reversed() usage

Simple demonstration of the reversed() built-in function.

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.

reversed() with different inputs

Calling reversed() with various argument types.

python
# More reversed() examples
print("reversed() is a Python built-in function")
print(f"Type: {type(reversed)}")

reversed() accepts different types of arguments and produces corresponding results.

Want to try these examples interactively?

Open Easy Playground