Python sets 🍴

Published: 30 November 2020
on channel: Bro Code
25,250
1.5k

Python sets tutorial explained

#python #sets #set

#set = collection which is unordered, unindexed. No duplicate values

utensils = {"fork","spoon","knife"}
dishes = {"bowl","plate","cup","knife"}

utensils.add("napkin")
utensils.remove("fork")
utensils.clear()
dishes.update(utensils)
dinner_table = utensils.union(dishes)

print(dishes.difference(utensils))
print(utensils.intersection(dishes))

for x in utensils:
print(x)

––––––––––––––––––––––––––––––
Up In My Jam (All Of A Sudden) by - Kubbi   / kubbi  
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
Free Download / Stream: http://bit.ly/2JnDfCE
Music promoted by Audio Library    • Up In My Jam (All Of A Sudden) – Kubb...  
––––––––––––––––––––––––––––––


On this page of the site you can watch the video online Python sets 🍴 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 30 November 2020, share the link with friends and acquaintances, this video has already been watched 25,250 times on youtube and it was liked by 1.5 thousand viewers. Enjoy your viewing!