I have this code that interleaves two words and outputs the new interleaved word as a tuple, but I need it too be a raw string.
from itertools import zip_longest
def interleave(word1,word2):
return ''.join(list(map(str, zip_longest(word1,word2,fillvalue=''))))
If inputting the words, cat and hat, this outputs
('h', 'c')('a', 'a')('t', 't').
But I need it to output
hcaatt
How could I go about formatting this list into a normal string