Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Check if list of Nodes contains a attribute

I am looking to check if a node already exists in my list, by an attribute of the node. Such as the following which isn't working:

if node.num not in [x.num for x in list]:
    print(node)

If list has an x such that x.num == 3 and also node.num == 3, I don't want to print node.

Comments