Review Note
Last Update: 05/03/2024 09:06 PM
Current Deck: Python::Python - Pythonic
PublishedCurrently Published Content
Front
Name 2 ways to reverse the order of the elements of this list?
l = [10, 44, 29, 30, 12, 99]
l = [10, 44, 29, 30, 12, 99]
Back
l[::-1] # works for all objects; harder to read, doesn't change object
l.reverse() # works for iterable objects; easy to read, changes object
Current Tags:
Pending Suggestions
No pending suggestions for this note.