Difference between two lists in python

0 votes
Given two lists, can we obtain all the elements that are present in one list but not there in another?
May 24, 2018 in Python by kaalabilli
• 1,090 points
259 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
difference = list(set(list1) - set(list2))
answered May 24, 2018 by Nietzsche's daemon
• 4,260 points

Related Questions In Python

0 votes
1 answer

Difference between append vs. extend list methods in Python

append: Appends object at end. x = [1, ...READ MORE

answered Jun 4, 2018 in Python by ariaholic
• 7,320 points
106 views
0 votes
1 answer

Difference between append vs. extend list methods in Python

append: Appends object at the end. x = ...READ MORE

answered Aug 8, 2018 in Python by bug_seeker
• 14,970 points
53 views
+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 56,120 points
71 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
22 views
+4 votes
6 answers
0 votes
1 answer

Copying lists in python

Assigning one list to another one simply ...READ MORE

answered Apr 30, 2018 in Python by Nietzsche's daemon
• 4,260 points
22 views
0 votes
1 answer

Using Lists and Tuples in Python

if you are familiar with C programming, ...READ MORE

answered May 29, 2018 in Python by Nietzsche's daemon
• 4,260 points
40 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.