Advertisement
elena1234

Sorted function in Python with key

Feb 3rd, 2022
1,518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. sequence_One = input().split(", ")
  2. sequence_Two = input().split(", ")
  3.  
  4. result = [substr for substr in sequence_One for text in sequence_Two if substr in text]
  5. print(sorted(set(result), key = result.index))
  6.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement