Files
30-seconds-of-code/snippets/reverse_string.md
2019-10-13 10:17:04 +05:30

19 lines
245 B
Markdown

---
title: reverse_string
tags: string,beginner
---
Returns the string after reversing it.
Use string slicing to rotate the string.
```py
def reverse_string(string):
return string[::-1]
```
```py
reverse_string("snippet") #"teppins"
```