Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to convert this iterative code on Python into a recursive code. RESTRICTIONS: No lists, No modules are allowed to be imported. The Question
I need to convert this iterative code on Python into a recursive code.
RESTRICTIONS: No lists, No modules are allowed to be imported.
The Question is that in a string, i have to remove non alphabetic characters such as numbers, symbols and whitespaces.
" 67&* bbbc&" should give "bbbc"
ITERATION CODE:
def remove_nonalpha(string): s = "" for i in string: if i.isalpha() == True: s = s + i return s
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started