Relative Content

Tag Archive for pythondictionary

Python returning non-sensical errors

Python seems to be returning errors that do not seem to make sense. might not be advanced enough to understand what’s going on, but it seems as if this is experiencing some major issue. I cannot tell what it is however, because the errors do not make any sense. Here’s the code snippet (line 18 starts at player equipped):

Adding values from one dictionary to another

dict_1 = {1: {2}, 2: {3}, 3: {4}, 4: {11}} dict_2 = {1: {2}, 2: {1}, 3: {4}, 4: {1,3}} to get: dict_1 = {1: {2}, 2: {3,1}, 3: {4}, 4: {11,1,3}} How would I add the values from dict_2 in dict_1 without deleting the ones already there? I can add them as a list […]