Use the - operator to get the difference of two sets

PHOTO EMBED

Tue Jun 18 2024 16:40:55 GMT+0000 (Coordinated Universal Time)

Saved by @pynerds #python

#Define the sets
A = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
B = {2, 3, 5, 7}

#get the difference using the - operator
diff = A - B
print(diff)
content_copyCOPY

https://www.pynerds.com/set-difference-method-in-python/