Question: Write a recursive function called reverse such that, given a string s , prints the characters of s in reverse order no credit if your

Write a recursive function called reverse such that, given a string s, prints the characters of s in reverse order
no credit if your solution is not recursive
HINTS
in python, if ss the String "abcde":
ss[0:5] is "abcde"
ss[0:4] is "abcd"
ss[0:3] is "abc"
ss[1:5] is "bcde"
ss[2:5] is "cde"
ss[3:5] is "de"
also
ss[0] is "a"
ss[1] is "b"
ss[4] is "e"
Examples:
% python3 reverseString.py
enter a string:
% python3 reverseString.py
enter a string: 1
% python3 reverseString.py
enter a string: 12
21
% python3 reverseString.py
enter a string: 1234567890
0987654321
% python3 reverseString.py
enter a string: abced
decba
%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!