Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
List comprehension to search and add
#python 3.5.2 list_1 = ['rwww corp\pan 2323 2018-23-23 0% c:\program files\pa.txt', 'rwww corp\pand 2323 2018-23-23 0% c:\program files\monkey.txt', 'c:\program files\pa.txt', 'c:\program files\pex2.txt', 'c:\program files\pex5.txt', 'c:\program files\pex4.txt', ] list_2 = ['c:\program files\pa.txt', 'c:\program files\pex2.txt', 'c:\program files\pex3.txt',] # You should not use list comprehension for this purpose # It will print items in list_1 if it also exists in list_2 [print(e, 'exists in list_1') for e in list_2 if e in list_1]
run
|
edit
|
history
|
help
0
Determine the weight of tiles at 10 grams each
PyBatScoreSOLID
Generating subsets
crown pattern
teretere
Iterator-1
Skillenza- Subjects
test1.py
gj
RemoveDuplication