Skip to content

Instantly share code, notes, and snippets.

@ChaitanyaBaweja
Last active July 12, 2019 16:17
Show Gist options
  • Save ChaitanyaBaweja/c2a40d22f514c577e173de44d99c1c0f to your computer and use it in GitHub Desktop.
Save ChaitanyaBaweja/c2a40d22f514c577e173de44d99c1c0f to your computer and use it in GitHub Desktop.
a = [1,2,3,4,5,6]
b = [1,5,6]
common_list = [i for i in a if i in b]
print common_list
# Output:
# [1, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment