My notes and examples while switching from Python2 to to Python3.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
213 B

#!/usr/bin/python3
setA = set([1,2,3,3,2])
setB = set([3,4,5])
setA|setB # Union
setA&setB # Intersection
setA-setB # In set A, but not set B
setB-setA # In set B, but not set A
var = setA&setB
print(var)