Tag: How to Initialize a Dictionary with 0 in Python?
How to Initialize a Dictionary with 0 in Python?
This tutorial will discuss about a unique way to initialise a dictionary with 0 in Python?. Suppose we have a list of keys. Like this, listOfKeys = [‘Ritika’, ‘Atharv’, ‘Smriti’, ‘Mathew’, ‘John’] We want to initialise dictionary from these keys but each key should have a default value zero associated with it. Like this, Advertisements …