Menu

gitpiper

reverse python Code Snippet in 2024

liststringbeginner

Last Updated: 13 April 2024

Reverses a list or a string.

  • Use slice notation to reverse the list or string.
def reverse(itr): return itr[::-1]
reverse([1, 2, 3]) # [3, 2, 1] reverse('snippet') # 'teppins'

python snippet similar to reverse For You in April 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️