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

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!