Video description
When working with Python dictionaries, sometimes your code has to deal with keys that may not be there; depending on the situation, this is trickier than it looks. In fact, your code may have a major bug in it right now! Learn the three different techniques for handling missing dict keys, their different strengths, and avoidable gotchas.
- Learn 3 coding methods to handle missing keys in your dictionary data structure
- Understand which method to use - when, and why, and the pros and cons of each method
- Learn how to practically apply each method and what problems each one solves
- Fully understand the nuances of the often maligned dict.get() method
Other videos in this series:
What are f-strings in Python and how can I use them?
Table of contents
Product information
- Title: How do I handle missing dictionary keys in Python?
- Author(s):
- Release date: June 2017
- Publisher(s): Infinite Skills
- ISBN: 9781491994849
You might also like
video
What are f-strings in Python and how can I use them?
In Python 3.6, a new method of formatting strings was introduced - f-strings. In this video, …
video
Python Bootcamp
Python Bootcamp Learn foundational Python with an emphasis for data In this course, you will learn …
book
Foundations of Libvirt Development: How to Set Up and Maintain a Virtual Machine Environment with Python
Discover the essential concepts of libvirt development and see how to interface to Linux virtualization environments, …
video
High-Performance Computing with Python 3.x
Python is a versatile programming language. Many industries are now using Python for high-performance computing projects. …