Software engineering and personal development

Month: March 2022

How to Quickly Find the Symmetric Difference of 2 Sets in Python

low-angle photography of brown concrete building during daytime
Photo by Samuel-Elias Nadler on Unsplash

If you have to find the union of elements that are either in the first or the second set, but not in both of them, then you need to use the symmetric difference.

This is also another math operation between sets that you have probably seen in a math class in high school.

This can be done quite easily and quickly using 2 built-in methods in Python.

Let’s start with the first one.

Continue reading

© 2024 Fatos Morina

Theme by Anders NorenUp ↑