#try to avoid input function a = (1,22,3,4,55,6,77,8,99,0) b = (11,22,33,44,55,66,77,88,99,100) inter = [] union = list(a) for i in a: if i in b: inter.append(i) for j in b: if j not in a: union.append(j) print(inter,union)
Click the run button. Try to avoid input() function.