I want to know how to find only common items on the two lists.
It would be nice if the -like_item_finding() returns [5]
-like_item_finding()
a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] Find the same_item_ (a, b)
The most Python-like method is
a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] result = list(set(a) & set(b))
a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] result = [x for x in a if x in b]
578 Understanding How to Configure Google API Key
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
914 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
1022 In Java servlet, when SHA-256 sends WW-Authenticate header for digest authentication, the client does not return the result.
© 2024 OneMinuteCode. All rights reserved.