Python List Reverse

Posted by linuxize on Aug 26, 2020 9:06 AM EDT
Linuxize.com
Mail this story
Print this story

When working with lists in Python, you may sometimes need to reverse the elements of a list. Reversing a list means that the first element of the list becomes the last, the second become second-to-last, the last element becomes the first, and so on. To reverse a Python list in place use the reverse() method. If you only need to create a reversed iterator use the reversed() function.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Developer, Python

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.