Files
30-seconds-of-code/snippets/reverse_string.md
2020-09-15 16:25:15 +03:00

18 lines
231 B
Markdown

---
title: reverse_string
tags: string,beginner
---
Returns the reverse of a string.
- Use string slicing to reverse the string.
```py
def reverse_string(s):
return s[::-1]
```
```py
reverse_string("snippet") #"teppins"
```