You can do something like this:
var inventory = {} # data inside here
func _ready():
for key in inventory.keys():
print("key: ", key, ", value: ", inventory[key])
This may be in the order you created the elements, but I wouldn't depend on it. If you really need strict ordering, then Dictionary is not the correct data structure, you should use an Array.