Advertisement
DiYane

Which Are In?

Sep 25th, 2023
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | Help | 0 0
  1. input_line_1 = input().split(', ')
  2. input_line_2 = input().split(', ')
  3.  
  4. result = []
  5.  
  6. for s1 in input_line_1:
  7.     if any(s1 in s2 for s2 in input_line_2):
  8.         result.append(s1)
  9.  
  10. print(result)
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement