Created
July 9, 2016 10:43
-
-
Save mohankumargupta/d9e4dfcf3aba3faa75ffa04b7702d694 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
from functools import reduce | |
mylist = [ | |
(0,0), | |
(0,0), | |
(5, 5), | |
(10,10), | |
(10,10), | |
(-2,-3), | |
(0,0) | |
] | |
def func(value, element): | |
if element in value: | |
return value | |
else: | |
return value + [element] | |
boo = reduce(func, mylist, []) | |
print(boo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment