In this Python Set "&" Oeprator lesson, we will learn Python Set Intersection.
We can compare different sets and find the common items in these sets with Python Set Intersection method.
Let’s show some examples:
Example 1:
******************************
numbers1 = {10,15,25,30,45,55}
numbers2 = {10,20,30,40}
print(numbers1.intersection(numbers2))
The output of this python code will be:
{10, 30}
Example 2:
******************************
numbers1 = {10,15,25,30,45,55}
numbers2 = {10,20,30,40}
print(numbers1 & numbers2)
The output will be:
{10, 30}
Python Set Intersection Lesson: https://ipcisco.com/lesson/python-set...
Python Operations Lesson: https://ipcisco.com/lesson/python-set...
Full Python Course: https://ipcisco.com/course/python-pro...
.
#pythonoperations #pythonoperators #pythonprogramming #python3 #pythoncourse #freepythoncourse
En esta página del sitio puede ver el video en línea Secrets Of Python Set "&" Operator | Python Set Intersection de Duración hora minuto segunda en buena calidad , que subió el usuario NetworkShip 30 marzo 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 62 veces y le gustó 3 a los espectadores. Disfruta viendo!