You are viewing a single comment's thread. Return to all comments →
number_element = int(input()) number_element_spaced = set(map(int, input().split())) numbers_of_other_sets = int(input())
for _ in range(numbers_of_other_sets): operations , no_elements = input().split() other_sets = set(map(int, input().split())) getattr(number_element_spaced,operations)(other_sets)
print(sum(number_element_spaced))
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 →
number_element = int(input()) number_element_spaced = set(map(int, input().split())) numbers_of_other_sets = int(input())
for _ in range(numbers_of_other_sets): operations , no_elements = input().split() other_sets = set(map(int, input().split())) getattr(number_element_spaced,operations)(other_sets)
print(sum(number_element_spaced))