Python Sets -Example 2 | intersection_update(),difference_update() & Symmetric_difference_update() |

Опубликовано: 17 Март 2024
на канале: Study2Share
29
0

Subset in Python Sets -Example 2 | intersection_update(),difference_update() & Symmetric_difference_update() |MUST WATCH
CODE:
x1={1,2,3,4}
x1.update([3,5])
print(x1)

#The intersection_update() method removes the items that is not present in both sets
#Same as x1 &= X2
x1.intersection_update([3,4])
print(x1)

#The difference_update() method removes the items that exist in both sets.
#Same as x1 -=x2
x1.difference_update([1,2])
print(x1)


#The symmetric_difference_update() method updates the original set
#by removing items that are present in both sets, and inserting the other items.
#Same as x1 ^=x2
x1.symmetric_difference_update([1,2])
print(x1)

🎓 Subscribe & Stay Tuned:

👍 Like, Share, and Comment:

🔗 Connect with us:
Set Playlist:    • Mastering Sets in Python | Study2Share Pyt...  
Python Playlist :    • Python Programming Essentials | Study2Shar...  
Visit My YouTube channel :    / pratikshah29  
Thank you for watching.
-----------------------------------------------------------
Like - Share - Comment - Subscribe.
------------------------------------------------------------
#python #programming #set #intersection #update #symmetric #difference #pythonprogramming #pythontutorial #pythonbasics #pythondatatypes #pythonforbeginners #pythonbeginner #python3 #pythonadvanced #pythonsets #pythonexamples #pythonexercises #programming #programmingpython #pythondevelopers #pythondevelopment #pythondeveloper #pythonseries #pythonmastery #pythonmodule #pythonfunction #pythonmethods


На этой странице сайта вы можете посмотреть видео онлайн Python Sets -Example 2 | intersection_update(),difference_update() & Symmetric_difference_update() | длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Study2Share 17 Март 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 29 раз и оно понравилось 0 зрителям. Приятного просмотра!