Created
March 6, 2015 12:20
-
-
Save asmaps/c1cc07a6529b207922aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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