added new snippet reverse_string

This commit is contained in:
kshivi99
2019-10-13 10:17:04 +05:30
parent 88bdc45108
commit 6c8944df90

View File

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