python get dict length code example Example 1: dictionary python length print(len(thisdict)) Example 2: python get size of dictionary d = {"foo": "bar"} size = len(d)