Python find numbers not in set
I would add all the items not in the set into a list.
s = set([1,2,3,35,67,87,95])
x = []
for item in range(1, 101):
if item not in s:
x.append(item)
print x
Set difference
set(range(1, 101)) - s
Use set difference operation
set(range(1, 101)) - s