Assume that S and T are assigned sets. Without using the join operator |, how can I find the union of the two sets? This, for example, finds the intersection:
S = {1, 2, 3, 4}
T = {3, 4, 5, 6}
S_intersect_T = { i for i in S if i in T }
So how can I find the union of two sets in one line without using |?
|? - Scott Bartell|? - matansterdef apply_set_operation(a, b, set_operation). When calling this function, I'd preferapply_set_operation(a, b, set.union)toapply_set_operation(a, b, set.__or__)- bsaa | binstead of calling a function to do that? - rodrigo-silveira