''' return a new string containing the 2 strings interwoven or zipped together. ex: Input: 'hi' 'ha' Ouput: hhia
Input: 'lzr','iad' output: lizard
def interleave(str1, str2):
ls1 = zip(str1, str2)
print(list(ls1))
# prints [('h', 'h'), ('i', 'a')] as expected
ls2 = [''.join(x) for x in ls1]
print(ls2)
# prints below. not as expected
# output: []
print(list(ls2))
# prints empty list. not as expected.
# output: []
# Below prints hhia correctly
ms1 = ''.join(''.join(x) for x in zip(str1,str2))
print(ms1)
# Output: hhia
interleave('hi','ha')
its working when i give in a single line (ms1). when i split and give its not working (ls1, ls2). Can anyone advise the root cause? '''