Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pointofpresence/7105fa61a28bc2088a6c9877fa418f16 to your computer and use it in GitHub Desktop.
Save pointofpresence/7105fa61a28bc2088a6c9877fa418f16 to your computer and use it in GitHub Desktop.
Python remove elements present in other list
# Python 3 code to demonstrate
# to remove elements present in other list
# using set()
set1 = set(['a', 'b'])
set2 = set(['c', 'b'])
res = list(set1 - set2)
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment