Advertisement
Spocoman

01. Which Are In?

Feb 11th, 2022 (edited)
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. first_list = input().split(', ')
  2. second_list = input().split(', ')
  3. third_list = []
  4.  
  5. for i in first_list:
  6.     for j in second_list:
  7.         if j.find(i) != -1:
  8.             third_list.append(i)
  9.             break
  10.            
  11. print(third_list)
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement