python loop through dictionary with index