+ 3
Fill in the blank to iterate over the value of dictionary and update value to zero. for index in temp.____ { temp[index]=0 }
8 ответов
+ 2
for index in temp.keys{
temp[index]=0
}
+ 1
You need to update value to zéro so you need to iterrate on the keys of each index in temps.
+ 1
Dictionaries uses Keys and Values
0
someone explain this please
0
thanks
0
this is simple to understand !
see goal of every programming language is to things what they are in real world. Now just think how will you show a dictionary " simply some search parameter and it's value . now when you are doing .keys you are trying to access keys and by for loop you are iterating on each key and setting it's value to zero
0
for index in temp.keys{ temp[index]=0 }