How to perform union of tuples in Python

1 Answer

0 votes
Tuple1 = (3, 6, 0, 9)
Tuple2 = (1, 4, 2, 8)

union = tuple(set(Tuple1 + Tuple2))

print(union)



'''
run:

(0, 1, 2, 3, 4, 6, 8, 9)

'''

 



answered Dec 4, 2022 by avibootz
...