2014-05-10 14:54:23 +01:00
|
|
|
try:
|
|
|
|
frozenset
|
|
|
|
except NameError:
|
|
|
|
print("SKIP")
|
2017-06-10 18:03:01 +01:00
|
|
|
raise SystemExit
|
2014-05-10 14:54:23 +01:00
|
|
|
|
|
|
|
sets = [
|
|
|
|
frozenset(), frozenset({1}), frozenset({1, 2}), frozenset({1, 2, 3}), frozenset({2, 3}),
|
|
|
|
frozenset({2, 3, 5}), frozenset({5}), frozenset({7})
|
|
|
|
]
|
|
|
|
for s in sets:
|
|
|
|
for t in sets:
|
|
|
|
print(sorted(s), '|', sorted(t), '=', sorted(s | t))
|
|
|
|
print(sorted(s), '^', sorted(t), '=', sorted(s ^ t))
|
|
|
|
print(sorted(s), '&', sorted(t), '=', sorted(s & t))
|
|
|
|
print(sorted(s), '-', sorted(t), '=', sorted(s - t))
|
|
|
|
u = s.copy()
|
|
|
|
u |= t
|
|
|
|
print(sorted(s), "|=", sorted(t), '-->', sorted(u))
|
|
|
|
u = s.copy()
|
|
|
|
u ^= t
|
|
|
|
print(sorted(s), "^=", sorted(t), '-->', sorted(u))
|
|
|
|
u = s.copy()
|
|
|
|
u &= t
|
|
|
|
print(sorted(s), "&=", sorted(t), "-->", sorted(u))
|
|
|
|
u = s.copy()
|
|
|
|
u -= t
|
|
|
|
print(sorted(s), "-=", sorted(t), "-->", sorted(u))
|
|
|
|
|
|
|
|
print(sorted(s), '==', sorted(t), '=', s == t)
|
|
|
|
print(sorted(s), '!=', sorted(t), '=', s != t)
|
|
|
|
print(sorted(s), '>', sorted(t), '=', s > t)
|
|
|
|
print(sorted(s), '>=', sorted(t), '=', s >= t)
|
|
|
|
print(sorted(s), '<', sorted(t), '=', s < t)
|
|
|
|
print(sorted(s), '<=', sorted(t), '=', s <= t)
|