Examveda

What will be the value of 'result' in following Python program?
list1 = [1,2,3,4]
list2 = [2,4,5,6]
list3 = [2,6,7,8]
result = list()
result.extend(i for i in list1 if i not in (list2+list3) and i not in result)
result.extend(i for i in list2 if i not in (list1+list3) and i not in result)
result.extend(i for i in list3 if i not in (list1+list2) and i not in result)

A. [1, 3, 5, 7, 8]

B. [1, 7, 8]

C. [1, 2, 4, 7, 8]

D. error

Answer: Option A


This Question Belongs to Python Program >> Introduction To Python

Join The Discussion

Related Questions on Introduction to Python