Advertisement
Rementai

Wspólne elementy

Mar 16th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. def common_elements(s1, s2):
  2.     list = ([x for x in set(s1) if x in set(s2)])
  3.     return list
  4.  
  5. s1 = (3, 3, 4, 5)
  6. s2 = (3, 3, 2, 5)
  7. print(common_elements(s1, s2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement