Question: *using python 3. Write a function double(s) that takes an arbitrary string s as input, and that uses recursion to construct and return the string
*using python
3. Write a function double(s) that takes an arbitrary string s as input, and that uses recursion to construct and return the string formed by doubling each character in the string. Here are three examples: >>doubleC'hello) >double('python) ppyytthhoonn >double(") T 1 This function is somewhat similar to the the replace function from lecture, because it needs to recursively create a new string from an existing string. However, your function will be simpler, because it won't need to decide what to do after the recursive call returns
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
