Closed hamikube closed 4 years ago
user_list = weights.keys()
for user in user_list:
...
del weights[user]
weight.keys()
is a keyview of weights
, which relies on the underlying storage of the dictionary, so you were iterating over weigts
while deleting something from it.
To fix it, you should use a copy of the keys list instead:
user_list = list(weigts.keys())
BTW, it is not related to this project. Close it now.
I want to fix the mentioned issue in the following codes:
When I run the program, the following issue appears:
How can I fix that runtime error issue?