You are viewing a single comment's thread. Return to all comments →
set_1 = set(map(int,input().split())) b = int(input()) for i in range(b): cmd = list(input().split()) operation = cmd[0] set_2 = set(map(int, input().split())) getattr(set_1, operation)(set_2) print(sum(set_1))
Seems like cookies are disabled on this browser, please enable them to open this website
Set Mutations
You are viewing a single comment's thread. Return to all comments →
set_1 = set(map(int,input().split())) b = int(input()) for i in range(b): cmd = list(input().split()) operation = cmd[0] set_2 = set(map(int, input().split())) getattr(set_1, operation)(set_2) print(sum(set_1))