Created
January 14, 2017 02:19
-
-
Save segfo/e65748b5a77ed9da74e98d732a797389 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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
a = ["abc","def","cdf","abc","abb"] | |
b = ["abc","def","cdf","abb","zbjl","klgjh","43whyur"] | |
def dupDel(seq): | |
seen = set() | |
seen_add = seen.add | |
return [ x for x in seq if x not in seen and not seen_add(x)] | |
for e in dupDel(a): b.remove(e) | |
print b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment