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
me
pythonfin
(P3) Rok przestępny
L5- part b
Convert to lowercase
GoogleCodindQues.py
linked_lists
probl2_203700377
on_off
linked_lists