repl.it
@charles2588/

RecursiveStringReverse

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
#Recursive way of string reverse
def reversestring(str):
	return str[len(str)-1::-1]
def recursivereversestr(str):
	if len(str)<1:
		return str
	else:
		return  recursivereversestr(str[1:])+str[0]
print(reversestring("ADCA"))
print(recursivereversestr("charles"))