Last active
June 11, 2017 02:59
-
-
Save pedrovhb/d310a2113d79cd444c1160a7861732b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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