Merge pull request #137 from kshivi99/add-reverse-string-snippet

[FEATURE] Snippet that reverses a string
This commit is contained in:
Angelos Chalaris
2019-10-13 23:30:45 +03:00
committed by GitHub

View File

@ -0,0 +1,17 @@
---
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"
```