how to count items in dictionary python code example
Example 1: how many keys in a dictionary python
> a = {'foo':42, 'bar':69}
> len(a)
2
Example 2: Python - Count the Number of Keys in a Python Dictionary
pythonCopydict1 = {'a':1,'b':2,'c':3}
print(len(dict1.keys()))