Created
December 25, 2017 14:07
-
-
Save monk1337/19acd0b6f6605d2fe25d98e2160bb7c7 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
original = 'Has two optional arguments which must be specified.' | |
strings = [{'index': 3, 'string': 'foo'}, {'index': 7, 'string': | |
'bar'}, {'index': 12, 'string': 'abc'}] | |
meta_data=[(i['index'],i['string']) for i in strings] | |
track={} | |
for i,j in enumerate(original): | |
track[i]=j | |
for k in meta_data: | |
if k[0] in track: | |
if track[k[0]]==' ': | |
track[k[0]]=k[1]+' ' | |
else: | |
track[k[0]] = k[1] | |
print("".join(track.values())) | |
#Hasfoo twobar optiabcnal arguments which must be specified. |
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
original = 'Has two optional arguments which must be specified.' | |
strings = [{'index': 3, 'string': 'foo'}, {'index': 7, 'string': | |
'bar'}, {'index': 12, 'string': 'abc'}] | |
meta_data=[(i['index'],i['string']) for i in strings] | |
track={} | |
for i,j in enumerate(original): | |
track[i]=j | |
for k in meta_data: | |
if k[0] in track: | |
if track[k[0]]==' ': | |
track[k[0]]=k[1]+' ' | |
else: | |
track[k[0]] = k[1] | |
print("".join(track.values())) | |
#Hasfoo twobar optiabcnal arguments which must be specified. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment