data dictionary python count code example Example: how many keys in a dictionary python > a = {'foo':42, 'bar':69} > len(a) 2