I am trying to print the distinct nodes in a graph when given a list of edges with the following:

```
def find_nodes(graph):
    # get the distinct nodes from the edges
    nodes = []
    l = len(graph)
    for i in range(l):
        edge = graph[i]
        n1 = edge[0]
        n2 = edge[1]
        if n1 not in nodes:
            nodes.append(n1)
        if n2 not in nodes:
            nodes.append(n2)
    return nodes

graph = ((1,2),(2,3), (3,1))
print find_nodes(graph)

```

But I only get `(1,2)` how am i missing the `3`?