Avatar ·

The difference in lists in Python [duplicate]

📁 List, question, example

(4 & nbsp; answers)
closed 7 years ago .

There are three lists: list1 , list2 and list3 . list1 is larger than list2 (by the number of elements), and list3 is empty.

It is also known that the first elements of list1 and list2 are the same (for example, list1 = [Vasya, Petya, Masha, Sasha] , and list2 = [Vasya, Petya] ).

Task: fill list3 with the difference of the first and second lists, i.e. in the above example list3 = [Masha, Sasha] .

No answers yet.

Log in to leave an answer

Blogs