Skip to content

Instantly share code, notes, and snippets.

@pedrovhb
Last active June 11, 2017 02:59
Show Gist options
  • Save pedrovhb/d310a2113d79cd444c1160a7861732b3 to your computer and use it in GitHub Desktop.
Save pedrovhb/d310a2113d79cd444c1160a7861732b3 to your computer and use it in GitHub Desktop.
s1 = 'abacate'
s2 = 'palmeiras'
def g(s1, s2):
d = [dict(zip([i for i in range(len(f))], [x for x in f])) for f in [s1, s2]]
for i in range(max([len(r) for r in d])):
for k in [False, True]:
yield d[k].get(i, '')
print(''.join([f for f in g(s1, s2)])) # apbaalcmaetieras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment