Question: Given three python lists list1 , list2 , and list3 , write python program to create two new lists: InList1 , InList2 , and Common

Given three python lists list1, list2, and list3, write python program to create two new lists: InList1, InList2, and Common. You can assume that each of the three lists: list1, list2, and list3, has no duplications. [you cant use concept of sets in python to solve this problem]

Items which are in list1 but not in list2 and not in list3 should be stored in InList1.

Items which are in list2 but not in list1 and not in list3 should be stored in InList2.

Common should be items which are in all three lists.

For example, if list1 = [1,2,3,4], list2=[2,3,4,6,7], and list3=[3,4,5]

InList1 should be [1]

InList2 should be [6,7]

Common should be [3,4]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!