Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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