Python sets 🍴

2024 ж. 22 Мам.
23 010 Рет қаралды

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: bit.ly/2JnDfCE
Music promoted by Audio Library • Up In My Jam (All Of A...
------------------------------

Пікірлер
  • # 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)

    @BroCodez@BroCodez3 жыл бұрын
  • Bro Code I got to say that your vids are amazing and your explanations are clear and easy to understand , you and you videos thought me a lot about python and computer science, and you are the one who inspired me to learn this subject! . I would really like if you could make a PHP course . be safe , keep making epic videos and thank you a lot !! :)

    @tamo5849@tamo58492 жыл бұрын
  • Thanks to you, everything was clear. I learned set and moving to the next one!

    @bekeshjr6412@bekeshjr6412 Жыл бұрын
  • Great tutorial as always! Nice and clear

    @niklasalexanderBjerkeland@niklasalexanderBjerkeland11 ай бұрын
  • VERY HELPFUL

    @St4rNoelleYT@St4rNoelleYTАй бұрын
  • thank you, great video and easy to follow!

    @kszoknyik@kszoknyik Жыл бұрын
  • It was very helpful, thanks.

    @dawn_22@dawn_222 жыл бұрын
  • Just form your video's am starting to love coding thx a lot

    @omar-hj8gm@omar-hj8gm Жыл бұрын
  • you are one of the best

    @mrfox8640@mrfox8640 Жыл бұрын
  • Good job!

    @John-ex3xc@John-ex3xc Жыл бұрын
  • loving it

    @manuelvaal1257@manuelvaal12572 жыл бұрын
  • Majestic

    @kemann3815@kemann3815 Жыл бұрын
  • GREAT VIDEO!

    @airlanggak5391@airlanggak53912 жыл бұрын
  • Awesome

    @kubach2897@kubach28973 жыл бұрын
  • Thanks for the video my Bro.

    @spartanranger@spartanranger2 жыл бұрын
  • Thank you for this

    @elandavidson4171@elandavidson41712 жыл бұрын
  • 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@BrainPermaDeD Жыл бұрын
  • Love it bro

    @usingThaForce@usingThaForce2 жыл бұрын
  • wow this seems very useful

    @hailsnover6214@hailsnover62143 жыл бұрын
  • nice

    @parham6676@parham66763 жыл бұрын
  • thank you

    @ahiamatagabriel5696@ahiamatagabriel5696 Жыл бұрын
  • thanks bro !

    @Paco_3010@Paco_30104 ай бұрын
  • Wow!

    @beingzero7541@beingzero75412 жыл бұрын
  • Thanks

    @FushigiMigi@FushigiMigi Жыл бұрын
  • Nice video bro

    @reef_lk@reef_lk3 жыл бұрын
  • Better than my paid course

    @shamaeelahmed3561@shamaeelahmed35612 жыл бұрын
  • ure amazing

    @dragomircristian8588@dragomircristian85882 жыл бұрын
  • Thank you. :)

    @varunwind@varunwind2 жыл бұрын
  • thx

    @ahmetaydn4416@ahmetaydn44162 жыл бұрын
  • Thx Senpai

    @vie1z814@vie1z8142 жыл бұрын
  • Say you combine dishes and utensils into a list. How would you find the unique # of only dishes in that list?

    @jacobshaull6455@jacobshaull6455 Жыл бұрын
  • I am the thousandth guy to like , so I deserve the shoutout!!!

    @sumanshuborkar5788@sumanshuborkar5788 Жыл бұрын
  • NİCEEEE

    @melihhopa2684@melihhopa26842 жыл бұрын
  • ❤❤❤

    @user-cu6fv9gn5z@user-cu6fv9gn5z2 жыл бұрын
  • noice

    @budderrar5751@budderrar5751 Жыл бұрын
  • 👍

    @tarikyassa1076@tarikyassa10762 жыл бұрын
  • An odd question perhaps, but what kind of situations do you use "sets" for? Why not stick with lists? What are the use cases?

    @Kotik112@Kotik1122 жыл бұрын
    • They're also great when you _want_ the uniqueness-property. If you use a list, an operation like appending lists has to be written by you (or a framework you use) to manually account for duplicate entries. Sets do it automatically, in C = faster again.

      @Owlrrex@Owlrrex2 жыл бұрын
  • Yea I did

    @godswillshouseofcomedy7253@godswillshouseofcomedy7253 Жыл бұрын
  • isnt eh {} are dictionaries and sets are (())?

    @boriskalashnikov8595@boriskalashnikov85957 ай бұрын
  • W Bro Code

    @MoDiscovery@MoDiscovery Жыл бұрын
  • is there any practical difference between "Ordered "and "Indexed"?

    @oximas-oe9vf@oximas-oe9vf Жыл бұрын
    • If I am not wrong, you can look to an unordered array for example, you can get any element of the array by the index without being necessary go through each element, but is not in a proper order

      @unacuentafalsamas4417@unacuentafalsamas4417 Жыл бұрын
  • So the random printing only works with strings?

    @Taran_K@Taran_K2 жыл бұрын
    • it also makes string interpolate randomly between ints if you have both in a set.

      @luizcastro5246@luizcastro52462 жыл бұрын
  • @asteiaellinikitv4193@asteiaellinikitv41932 жыл бұрын
  • For the algorithm.

    @shanchar@shanchar Жыл бұрын
  • : D

    @mikoajnowakowski149@mikoajnowakowski149 Жыл бұрын
  • ;)

    @hamzaammar4356@hamzaammar43562 жыл бұрын
  • KZhead algorithm comment

    @pbsmoothie7281@pbsmoothie7281 Жыл бұрын
  • mnom

    @rondomzneta6972@rondomzneta6972 Жыл бұрын
  • bro codes

    @xeurek4@xeurek43 ай бұрын
  • I am the first one to dislike to I deserve a shoutout

    @bushragul2321@bushragul2321 Жыл бұрын
  • nice

    @naylinaung4688@naylinaung46882 жыл бұрын
KZhead