In this lesson, you’ll learn about sets. Sets are unsorted collections that allows for adding, removing, and checking membership in constant time. They do not allow duplicates. Here’s an example:
>>> s = set()
>>> s.add('h')
>>> s.add('h')
>>> s.add('i')
>>> s
{'h', 'i'} # Could appear in any order
>>> set("hello")
{'e', 'h', 'l', 'o'}
If you want to learn more, check out Sets in Python.
You also heard about Big O analysis, which is a way to analyze the speed and memory usage of a function or block of code. See Wikipedia Time complexity for more information.
James Uejio RP Team on April 27, 2020
If you want to learn more, here is a Real Python walkthrough video on sets: Sets in Python
I also talk about Big-O analysis which is a way to analyze the speed and memory usage of a function or block of code. See Wikipedia Time complexity for more information.