Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions