Created
April 9, 2022 12:45
-
-
Save pointofpresence/7105fa61a28bc2088a6c9877fa418f16 to your computer and use it in GitHub Desktop.
Python remove elements present in other list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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