I have to actually solve the problem in the image. But I am unable to get why it is generating attribute error. can someone please explain what it means and how it can be avoided in my code.[ problem ]
A= int(input())
set1=set(map(int,input().split()))
N=int(input())
for i in range(N):
k,*a=input().split()
set2=set(map(int,input().split()))
set1.k(set2)
print(sum(set1))
set1.k(set2). what are you trying to do here? If you want to update or add use:
set1.add(set2)
set1.update(set2)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.