So, imagine I got a dict like this:
dict = {
"100311929821626368" : {
"battles" : 2,
"loses" : 0,
"maxstamina" : 50,
"news" : True,
"stamina" : 50,
"weeb" : "Chuey",
"wins" : 0
},
"100802430467325952" : {
"battles" : 4,
"loses" : 0,
"maxstamina" : 50,
"news" : True,
"stamina" : 45,
"weeb" : "Red Haired Bastard",
"wins" : 0
},
"101970309296447488" : {
"battles" : 1,
"loses" : 0,
"maxstamina" : 50,
"news" : True,
"stamina" : 45,
"weeb" : "Niusky",
"wins" : 1
}
}
and my code is this code:
wow = 0
for id in dict:
for i in dict[id]["battles"]:
wow += i
The problem is, I'm not sure how to add all the battles int at once. Because I get this error:
TypeError: 'int' object is not iterable
How would i fix it so it all all the battles in the dict!