menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Python Mor...
source image

PlanetPython

4w

read

66

img
dot

Image Credit: PlanetPython

Python Morsels: Looping in reverse

  • Any reversible iterable can be reversed using the built-in reversed function whereas Python's slicing syntax only works on sequences.
  • Reversing sequences with slicing: Using Python's slicing syntax, a sequence like a list can be reversed by using [::-1].
  • The list reverse method: The article discusses the list reverse method as an alternative for reversing sequences.
  • For more details, you can read the full article at: https://www.pythonmorsels.com/looping-in-reverse/

Read Full Article

like

4 Likes

For uninterrupted reading, download the app