Introduction
Why use sets and frozen sets?
()
What you should know
()
1. Introduction to Sets
Introduction to sets
()
Defining a set and common pitfalls while initializing a set
()
Immutable and mutable
()
Hashable and iterable
()
2. Set Operations
Set membership
()
Iterating through a set
()
Set comprehension
()
Challenge: Create a set
()
Solution: Create a set
()
3. Operators and Methods
Understand set theory with an example
()
Find all the elements present in different sets
()
Find the common elements present between the sets
()
Determine the difference between two sets
()
Determine the symetric difference between two sets
()
Determine whether two sets have any common elements
()
Determine whether one set is a subset of another
()
Determine whether one set is a superset of another
()
4. Modifying a Set
Add an element to a set
()
Add multiple elements with the update method
()
Remove an element from a set
()
Remove an element from a set using discard
()
Using pop to remove and return an element from a set
()
Clearing all elements from a set
()
5. Using Built-In Functions
Find the index and value for all the items of a set
()
Using length to find the number of items in a set
()
Find the largest element in the set
()
Find the smallest element in the set
()
Sort all the elements in the set
()
Find the sum of all elements in a set
()
6. Frozen Sets
Introduction to frozen sets
()
Why frozen sets?
()
Creating frozen sets
()
Conclusion
Keep practicing
()
Ex_Files_Python_Data_Sets.zip
(47 KB)