DiscreteMathematics/Lab_1/z_calculations.py

22 lines
476 B
Python
Raw Normal View History

2024-03-09 17:44:57 +02:00
def z_calculations(input_sets, u_set):
x = u_set - input_sets[1]
y = u_set - input_sets[0]
results = set()
for curr_elem in x:
if (curr_elem not in y):
results.add(curr_elem)
for curr_elem in y:
if (curr_elem not in x):
results.add(curr_elem)
return [x, y, results]
def z_calculations_in(input_sets, u_set):
x = u_set - input_sets[1]
y = u_set - input_sets[0]
results = x ^ y
return results