Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

# difference between list 1 and list 2

# difference between list 1 and list 2

list1 = [5,7,9,27,10,30,40,50,75,47,66,89,121,566,100]
list2 = [5,7,9,27,10,30,40,75,66,89,121,566,100] 
list3 = set(list2)
dif = [item for item in list1 if item not in list3]
print(dif)

# [50, 47]
Comment

PREVIOUS NEXT
Code Example
Python :: for i in range(1, 11): print(i, end="") 
Python :: matplotlib get colorwheel 
Python :: turn of legend pairplot 
Python :: Linear Search Python with enumerate 
Python :: how call a class in another class python 
Python :: python regex type hint 
Python :: axis legend get labels and handles 
Python :: python online compiler with libraries 
Python :: pyttsx3 ichanging voices 
Python :: custom port odoo 
Python :: how to convert matlab code into python 
Python :: Convert Int to String Using F-strings 
Python :: Math Module fabs() Function in python 
Python :: remap values in a column based on condition from another dataframe 
Python :: copy director structure python 
Python :: passing list vs int in python important 
Python :: velocity field gradient 
Python :: get complete path from reletive path python 
Python :: ax text not placed correclty 
Python :: Python NumPy atleast_1d Function Example when inputs are in high dimension 
Python :: brython sample 
Python :: Python NumPy asfortranarray Function Tuple to an array 
Python :: add a new field to a Hosted Feature Layer 
Python :: como saber si un string es un numero python 
Python :: find max in for scartch python 
Python :: godot knockback 
Python :: django view - mixins and GenericAPIView (list or create - GET, POST) 
Python :: Python matplotlib multiple bars 
Python :: Concatenation of two range() functions 
Python :: BeautifulSoup : Fetched all the links on a webpage how to navigate through them without selenium 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =