python3 get list size code example Example 1: python add to list with index list.insert(index, element) Example 2: python get size of dictionary d = {"foo": "bar"} size = len(d)