Sets in Python - Advanced Python 04 - Programming Tutorial

preview_player
Показать описание
In this Python Advanced Tutorial, we will be learning about Sets in Python. A Set is a collection data type that is unordered and mutable, but unlike lists or tuples it does not allow duplicate elements. We will go over how you can use them and some advanced techniques that can be applied to sets.

~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~

📚 Get my FREE NumPy Handbook:

📓 Notebooks available on Patreon:

A written Tutorial can be found here:

You can find me here:

#Python

----------------------------------------------------------------------------------------------------------
* This is a sponsored or an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

I just saw this video and went to hackerrank and completed all the problems that are under the label of "sets". Thank you for the simple way of explanation.

harshabuddana
Автор

You can also use "|" to update 2 sets


combination = setA | setB

_jirkaa_
Автор

I think you covered pretty much everything on the choosen topics...Nice tutorial i like it.. If possible please make some videos on Adavanced Dajngo and RestApi sessions.

iamvijay
Автор

oh my gosh, I learned a lot here, my notepad is full of information that I took from this class, thanks so much from Brazil

GabrielOliveira-mmdz
Автор

Nice and professional videos. Thumb up! Keep it up

traktorista
Автор

Sets - test your comprehension:
- how to initialize a set? (1 way)
- how to convert a list to set?
- how to copy a set? (2 ways)
- what is the result of `set("hello")`: ('h', 'e', 'l', 'o') or ("helo")?
- will {} create an empty set?
- how do you initialize an empty set?
- how to add to set?
- what's the difference between remove and discard?
- what does pop() do?
- how to union two sets? (2 ways)
- explain intersection() vs intersection_update()
- what is an equivalent of s1.difference(s2)?
- explain difference vs symmetric_difference
- how to check if s1 contains all elements of s2?
- what does `s2.issuperset(s1)` do?
- write a single-line code equivalent to isdisjoint()
- how to initialize an immutable set?

ronyut
Автор

Thank you so much for the detailed explanation of set methods.

doniyorabduvokhidov
Автор

Thank you so much! I use your videos as a reference when I need to figure out something!

revolutionN
Автор

Thank you very much, I am really enjoying your videos.

AhmadAsmndr
Автор

1. Amazing Video
2. Do make video about Python framework
3. Which ide you use in MAC

KanwalJeetSinghHanspal
Автор

this is gold mine for DSA, is it possible for you to upload user defined data structures too ? include Stack, Queue, Linked List, Tree, Graph and HashMap.

gunahawk
Автор

i have question in other languages if we have objects type item then we need to pass some sort of comparer then how does it work in python

priyanshu
Автор

Hi, did anyone understand what's the difference between union() and update()?
Seems like they both bring eventually the same result...
Same goes for intersection() and intersection_update()...

***
Edit:
Okay, it's easy.
If the method's name does NOT contain the word `update`, then it won't update and just return another set and won't affect the current one (the set that the method has been applied on).
Otherwise (the method name contains the word `update`), the current set *itself* will update!

ronyut
Автор

11:18 They should have called something like 'tetris_merge()'.

CavanLeeSears
Автор

Change the name for this video series. This is beginner stuff. Don't
lie to people by calling it advanced. You lose your credibility from
the start when you LIE to people right from the start.

drnotebook