Python Snippets
Python Dictionaries and Loops
In this post we cover various ways we can iterate over dictionaries. Learn how to use the items and values methods to write more Pythonic loops with dicts.
Python Snippets
In this post we cover various ways we can iterate over dictionaries. Learn how to use the items and values methods to write more Pythonic loops with dicts.
Python Snippets
zip is an incredibly powerful tool, but it has its limitations. Learn about zip_longest so you can zip collections of any length without losing data!
Python Snippets
Python's zip function is extremely powerful and can simplify your code greatly, particularly when working with multiple iterables at the same time. In this post we cover a few ways to use it!
Python Snippets
Print is one of the first functions we encounter when learning Python, but it can do a lot more than say "Hello, world!". Learn about print's other options and master this common function!
Python Snippets
This week we take a look at some of Python's hidden Easter eggs, including perhaps the most important module in all of Python: antigravity.
Python Snippets
Deques are a very handy collection type from the built-in "collections" module. They extend the functionality of lists and give us a couple more useful methods. Learn about them in this post!
Python Snippets
This week we continue our look at the itertools module, this time covering the permutations and combinations functions.
Python Snippets
The itertools module contains a bunch of handy functions. Here we take a look at product, which can serve as a replacement for complex comprehensions.
Python Snippets
In this Python snippet post we cover a lesser known set method: symmetric_difference.
Python Snippets
In this snippet post we show you how to add conditional clauses to your list comprehensions. Once you know how to use it, this kind of filtering is very powerful.
Python Snippets
Learn how to use Python's list comprehension syntax: an awesome, Pythonic tool for creating new lists from existing iterables.
Python Snippets
In this Python snippet post we take a look at the enumerate function: a vital tool for creating Pythonic loops.