You are viewing a single comment's thread. Return to all comments →
m = int(input()) A = input() n = int(input())
setA = set(map(int, A.split()))
for i in range(n): line1 = input() B = input()
words= line1.split() op = words[0] np = int(words[1]) list2= B.split() setB = set(map(int, list2)) #setA= setA.op(setB) getattr(setA, op)(setB)
sum = 0 for i in setA: sum = sum + i print(sum)
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 →
m = int(input()) A = input() n = int(input())
setA = set(map(int, A.split()))
for i in range(n): line1 = input() B = input()
sum = 0 for i in setA: sum = sum + i print(sum)