reversed()
function is used to find the the reversed iterator of the given sequence in Python for the given input.
reversed()
function is a part of Python Built-in Functions.
Syntax of reversed()
Function
The syntax of
reversed()
function in Python is:
reversed(seq)
Parameters of reversed()
Function in Python
x
– Where x
is any valid . This parameter is required.
Compatibility
reversed()
function is available and compatible with both Python 2.x
and 3.x
.
Return Value of reversed()
Function in Python
reversed()
function returns the reversed iterator of the given sequence for the given input.
Python reversed()
Function Example 1
Example CODE
Output:
Python reversed()
Function Example 2
Example CODE
Output: