I want to check if a list of tuples contains a specific tuple. If
![[Image: 6DHp5pg.jpg]](https://i.imgur.com/6DHp5pg.jpg)
So when looking if ("a","c") is contained in the list, return should be FALSE. However right now it returns TRUE. Any ideas why?
numbers = [('a','a'), ('c','a')]
look = ('a','c')"look" should not be contained in "numbers". But that's how my code thinks right now. def find_edge(self, src, dst):
"""
Returns True if there's an edge from node `src` to node `dst`.
"""
# Check if nodes exist
if self.find_node(src) is True and self.find_node(dst) is True:
src_node = self.return_head(src)
src_edges = src_node.list_edges()
src_edges_weightless = [x[:-1] for x in src_edges]
possible_edge = (src, dst)
for elem in src_edges_weightless:
if collections.Counter(elem) == collections.Counter(possible_edge):
return True
return False![[Image: 6DHp5pg.jpg]](https://i.imgur.com/6DHp5pg.jpg)
So when looking if ("a","c") is contained in the list, return should be FALSE. However right now it returns TRUE. Any ideas why?
