Computer Science, asked by prabhathklm, 3 months ago

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 upsales
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