Pinned Tweet
🔽 Content Directory 🔽
All content posted on this page will be divided into specific series, which you will find below.
Learn about Static vs Dynamically typed languages and their inherent tradeoffs:
youtube.com/watch?v=87VOk4ao…
Python Twitter Bot - The Best Project for Beginners
Learn how to make a Python Twitter bot that parses RSS feeds and uses the Twitter API to post tweets:
youtu.be/xsSXL5iuzDg
Python Twitter Bot - The Best Project for Beginners
Learn how to make a Python Twitter bot that parses RSS feeds and uses the Twitter API to post tweets:
youtu.be/xsSXL5iuzDg
Hash Tables - The Most Important Data Structure
If you've ever used a dictionary in Python before, then you've used a hash table, which is a data structure that stores key-value pairs and offers extremely fast data retrieval speeds.
But how do they work internally?
When the hash table reaches a load factor of around .7, most implementations will re-size the hash table.
This usually involves doubling the size of the hash table, and re-hashing each element to enter it into the new array.
This brings the load factor back down, since we keep the # of stored elements constant, while increasing the # of total buckets.
Resizing and re-hashing is in itself an O(n) operation, since we need to copy each element into the new array.
Learn this content on YouTube for more details on this topic:
youtube.com/watch?v=N7Dr37fS…
Printing out dictionaries in your Python code? Use the pprint library for more readable output ⬇️
youtube.com/shorts/5GNbzDqAu…
Python Sets Dominate Lists for Quick Searches
If your list searches are taking forever, consider converting the list to a set first. Let's find out why ⬇️
Sets are implemented using a hash table
When we add an item into a set, Python computes where the item should be added into the hash table by passing the item through a hash function.
This means, when we want to search for an element, Python calculates the hash of the element we are searching for, and indexes directly into the hash table
This gives us an average of O(1) lookup time, since we know exactly where to look to check if the element is in the set.
Use the Enumerate Function in your Python Loops
We often have code like this where we keep track of an index variable, which represents the current position of the list we are looping through
But there's a better way to do this - the enumerate function. The enumerate function takes in a sequence and returns an iterable of index and item pairs
We can also use the start parameter to control where the index should start from (it defaults to 0). In this example, we set our index to start from 1
This content is in video format also, if you prefer to learn that way:
youtube.com/shorts/SoSXi0Qbb…










