In the previous tutorial, we introduced you to a little test driven development with Python (TDD). Welcome! to the second part of our Python TDD tutorial. Here we are going to continue the development of propers library.
Python dictionary is an easy to use data structure. In the previous tutorial I covered creating, setting values, deleting values and checking existence of a key. For this tutorial I am going to cover how to access keys, values and items, how to use dictionary comprehension and many more.
Python 3 dictionary is a versatile and easy to use hash-map implementation. It is simply a built-in data type that you can hack upon.
For loops are one of the basic iterative structures available in most programming languages. You’ll also find that there is a variant of typical for loops called foreach loops that lets you access elements of a sequence. In python 3, the for loop works similarly to the foreach loop.