+ 3
Python - What does {1|2}|{1}|{2} mean?
zzz = {1|2}|{1}|{2} print(zzz) How did we get {1,2,3} as the output?
1 Answer
+ 7
1|2 = 3
bitwise or |
01
10
--------
11
The union operator | combines two sets to form a new one containing items in either.
{3} | {1, 2} = {1, 2, 3}
https://www.sololearn.com/learn/4073/?ref=app