Files
30-seconds-of-code/snippets/reverse_string.md
Kumar Shivam cc46571a14 Update snippets/reverse_string.md
Co-Authored-By: Angelos Chalaris <chalarangelo@gmail.com>
2019-10-13 14:59:01 +05:30

18 lines
239 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(string):
return string[::-1]
```
```py
reverse_string("snippet") #"teppins"
```