Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

find common elements in two lists python

list1 = [1,2,3,4,5,6]
list2 = [3, 5, 7, 9]
list(set(list1).intersection(list2))
Comment

find common words in two lists python

list1 = ['little','blue','widget']
list2 = ['there','is','a','little','blue','cup','on','the','table']

list3 = set(list1)&set(list2)

list4 = sorted(list3, key = lambda k : list1.index(k))
Comment

PREVIOUS NEXT
Code Example
Python :: shuffle array python 
Python :: word pattern in python 
Python :: logout in discord.py 
Python :: send email with python 
Python :: pandas remove rows with null in column 
Python :: py exe tkinter 
Python :: sqlalchemy delete by id 
Python :: python check is admin 
Python :: import data in pandad 
Python :: django round 2 decimal 
Python :: dict godot 
Python :: saving to csv without the index 
Python :: how to delete everything on a file python 
Python :: python head function show all columns 
Python :: pandas from series to dataframe 
Python :: python check if variables are the same 
Python :: jupyter themes 
Python :: python how to return max num index 
Python :: reset index 
Python :: longest substring without repeating characters python 
Python :: python dict order a dict by key 
Python :: simple thresholding with OpenCV 
Python :: intersection in list 
Python :: how to fix geometry of a window in tkinter 
Python :: flask clear session 
Python :: can you edit string.punctuation 
Python :: launch google chrome using python 
Python :: python system of equations 
Python :: system commands in python windwos 
Python :: with python how to check alomost similar words 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =