Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Last active May 8, 2021 11:24
Show Gist options
  • Save computer-tutor/08d427710346b103eaa6274490ba3c7e to your computer and use it in GitHub Desktop.
Save computer-tutor/08d427710346b103eaa6274490ba3c7e to your computer and use it in GitHub Desktop.
a=[1,1,2,3,4,5,8,13,21,34,55,89]
b=[1,2,3,4,5,6,7,8,9,10,11,12,13]
def common_elements(a,b):
a_set=set(a)
b_set=set(b)
if (a_set & b_set):
print(a_set & b_set)
else:
print("Two lists have nothing on common!")
common_elements(a,b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment