number = [1, 2, 3, 4, 5]
odd = [1, 3, 5]
even = [2, 4]
print(list(set(number) - set(odd))) # [2, 4]
print(list(set(number) - set(even))) # [1, 3, 5]
print(list(set(odd) - set(even))) # [1, 3, 5]
目次
number = [1, 2, 3, 4, 5]
odd = [1, 3, 5]
even = [2, 4]
print(list(set(number) - set(odd))) # [2, 4]
print(list(set(number) - set(even))) # [1, 3, 5]
print(list(set(odd) - set(even))) # [1, 3, 5]