I am getting the following error when trying to add a value to the dictionary. However, I am printing out the key and value right before adding to dictionary. I am also adding values to a different dictionary in the same manner elsewhere in the process so I am unsure why this is happening now.
You aren’t getting that error when you’re adding it. You’re getting that error when you try to output the value, because the key doesn’t exist yet.