Q 5.Give outputs
a)
def reverse(s):
if len(s)==1:
return s[0]
else:
return(s[-1]+reverse(s[0:len(s)-1)) print(reverse("Recursion"))
Answers
Answered by
4
Answer:
Q 5.Give outputs
a)
def reverse(s):
if len(s)==1:
return s[0]
else:
return(s[-1]+reverse(s[0:len(s)-1)) print(reverse("Recursion")
Q 5.Give outputs
a)
def reverse(s):
if len(s)==1:
return s[0]
else:
return(s[-1]+reverse(s[0:len(s)-1)) print(reverse("Recursion")
Q 5.Give outputs
a)
def reverse(s):
if len(s)==1:
return s[0]
else:
return(s[-1]+reverse(s[0:len(s)-1)) print(reverse("Recursion")
Q 5.Give outputs
a)
def reverse(s):
if len(s)==1:
return s[0]
else:
return(s[-1]+reverse(s[0:len(s)-1)) print(reverse("Recursion")
Q 5.Give outputs
a)
def reverse(s):
if len(s)==1:
return s[0]
else:
return(s[-1]+reverse(s[0:len(s)-1)) print(reverse("Recursion")
Similar questions