Python Dictionary Length


Dictionary Length

To determine how many items (key-value pairs) a dictionary has, use the len() method.

Example

Print the number of items in the dictionary:

print(len(thisdict))
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.