pythonReverse a list using slicing
list_a = ["foo", "bar", "baz"]
list_reversed = list_a[::-1]
print(list_reversed)ctrl + c[::-1]slicing operator where the index is accessed as |
More of Python
- One-liner if else
- Remove duplicate lines from text file
- Combine 2 csv files using ID column
- Combine multiple txt files into one
- One-liner calculator
- How to swap two variables values
- How to get hour from datetime
- How to validate xml
- How to check if object is of certain type
- How to get minutes from datetime
See more codes...