Files
30-seconds-of-code/snippets/reverse_list.md
2020-10-06 01:15:12 +05:30

17 lines
227 B
Markdown

---
title: reverse_list
tags: list,beginner
---
Returns the reverse of a list.
- Use list slicing to reverse the list.
```py
def reverse_list(arr):
return arr[::-1]
```
```py
reverse_list([1,6,7,0,5]) #[5, 0, 7, 6, 1]
```