I have the following program:
Write a function that receives two strings as parameters and return a new string consisting of the first, but with the second string interleaved between each letter of the first.
For example if the strings are "peace" and "so", then your function should return "psoasozso"
My code:
def intercalar(string_a,string_b):
r = " "
i= 0
l=len(string_a)
while i < l:
print(string_a[i] + string_b),\
i = i + 1
return r
#variables
a=raw_input("Ingrese palabara a: ")
b=raw_input("Ingrese palabara b: ")
variables=intercalar(a,b)
print(variables)
For the words: a = peace and b = os returns me: pso aso zso
If I use print(string_a[i] + string_b),end = ''
, I get an error.
Can someone help me?