I use python only occasionally, sorry for a seemingly trivial question
>>> a = set(((1,1),(1,6),(6,1),(6,6)))
>>> a
set([(6, 1), (1, 6), (1, 1), (6, 6)])
>>> a - set(((1,1)))
set([(6, 1), (1, 6), (1, 1), (6, 6)])
>>> a.remove((1,1))
>>> a
set([(6, 1), (1, 6), (6, 6)])
why ‘-‘ operator didn’t delete the element but the remove did ?
Because you missed a comma:
should be:
or, to be more readable:
or even (Py2.7+):