Question
[Python]Write a recursive function recStrMerge () that takes two strings s1 and s2 as parameters and returns a string that consists of the two strings
[Python]Write a recursive function recStrMerge() that takes two strings s1 and s2 as parameters and returns a string that consists of the two strings merged together. The string returned by the function should the first character of s1 followed by the first character of s2 followed by the second character of s1 followed by the second character of s2, etc. If one string runs out of characters before the other, then the remaining string should appear at the end of the merged string. The only string functions you are allowed to use are len(), concatention, indexing (s[i] for an integer i), or slicing (s[i:j] for integers i and j). The following shows several sample runs of the function:
Python 341 Shell File Edit Shell Debug Options Windows Help recStr Merge abc y axbycz s recStr Merge abcd 123456 l alb2c3 d456 recStr Merge abcdefghii, t() recStr Merge abc II) abc recStr Merge 11, 123 123 recStr Merge Ln: 59 Col 4
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