- Code:
x = [1, 2, 3, 4]
y = [5, 6, 3, 4]
minus = [num for num in x if num not in y]
print(minus)
https://en.wikipedia.org/wiki/Complement_(set_theory)
x = [1, 2, 3, 4]
y = [5, 6, 3, 4]
minus = [num for num in x if num not in y]
print(minus)
BullyWiiHacks » Resources » Programming Code » Python » Python - Set Theoretic Compliment / Set Minus
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum