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
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
Get step-by-step solutions from verified subject matter experts
