Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = set(input('Enter first set of characters: '))
- t = set(input('Enter second set of characters: '))
- print('Set 1:', s)
- print('Set 2:', t)
- union_set = s.union(t)
- print('Union of the two sets:', union_set)
- # The output will be:
- Set 1: {'a', 'p', 'l', 'e'}
- Set 2: {'r', 'a', 'n', 'g', 'e', 'o'}
- Union of the two sets: {'a', 'p', 'l', 'e', 'r', 'n', 'g', 'o'}
Advertisement
Add Comment
Please, Sign In to add comment