Python sets 🍴

preview_player
Показать описание
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"}

for x in utensils:
print(x)

––––––––––––––––––––––––––––––
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
––––––––––––––––––––––––––––––
Рекомендации по теме
Комментарии
Автор

# 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)




for x in utensils:
print(x)

BroCodez
Автор

Just form your video's am starting to love coding thx a lot

omar-hjgm
Автор

Thanks to you, everything was clear. I learned set and moving to the next one!

bekeshjr
Автор

The sets in python seems similar to what we studied in math class. Anyways, thank you for the free classes. Hope you are doing well👍.

BrainPermaDeD
Автор

Great tutorial as always! Nice and clear

niklasalexanderBjerkeland
Автор

thank you, great video and easy to follow!

kszoknyik
Автор

Say you combine dishes and utensils into a list. How would you find the unique # of only dishes in that list?

jacobshaull
Автор

isnt eh {} are dictionaries and sets are (())?

boriskalashnikov
Автор

I am the thousandth guy to like, so I deserve the shoutout!!!

sumanshuborkar
Автор

An odd question perhaps, but what kind of situations do you use "sets" for? Why not stick with lists? What are the use cases?

Kotik