A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_func_reversed.asp below:

Website Navigation


Python reversed() Function

Python reversed() Function

❮ Built-in Functions

Example

Reverse the sequence of a list, and print each item:

alph = ["a", "b", "c", "d"]
ralph = reversed(alph)
for x in ralph:
  print(x)

Try it Yourself » Definition and Usage

The reversed() function returns a reversed iterator object.

Syntax Parameter Values Parameter Description sequence Required. Any iterable object Related Pages

The iter() function returns an iterator object.

The list.reverse() method reverses a List.

❮ Built-in Functions

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4