Skip to content

Instantly share code, notes, and snippets.

@asmaps
Created March 6, 2015 12:20
Show Gist options
  • Save asmaps/c1cc07a6529b207922aa to your computer and use it in GitHub Desktop.
Save asmaps/c1cc07a6529b207922aa to your computer and use it in GitHub Desktop.
asmaps@asmaps-x240 ~/tmp % cat test.py
d = {
'bla': [['a', 'b', 'bla', 'c'], ['d', 'e', 'bla']],
'foo': [['a', 'b', 'foo', 'c'], ['d', 'e', 'foo']],
}
for key, value in d.iteritems():
for l in value:
l.remove(key)
print(d)
asmaps@asmaps-x240 ~/tmp % python test.py
{'foo': [['a', 'b', 'c'], ['d', 'e']], 'bla': [['a', 'b', 'c'], ['d', 'e']]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment