Westonci.ca is the Q&A platform that connects you with experts who provide accurate and detailed answers. Discover comprehensive solutions to your questions from a wide network of experts on our user-friendly platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

array Write a recursive function stringReverse that takes a string and a starting subscript as arguments, prints the string backward and returns nothing. The function should stop processing and return when the end of the string is encountered. Note that like an array, the square brackets ( [ ] ) operator can be used to iterate through the characters in a string.

Sagot :

user_in = str ( input ("Please enter a phrase: " ))

def reverse_str (string):

e = 0

for e in range (len (string)):

x = -1

print string[x]

x += (len (string))