Languages
[Edit]
EN

Python - print difference of two sets

0 points
Created by:
Fletcher-Peralta
778

In this article, we would like to show you how to print the difference of two sets in Python.

Practical example

Edit

In this example, we use symmetric_difference_update() to get the difference of my_set1 and my_set2.

Output:

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Python - set (popular problems)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join