Computer Science, asked by rkrishna5355, 18 days ago

14. Predict the output : dct = {} dct[1] = 1 dct['1'] = 2 dct[1.0] = 4 sum = for k in dct: print(k, sum) sum += dct[k] print (sum) = 0​

Answers

Answered by mia780224
2

Answer:

6

Explanation:

firstly "dic1" dictionary variable allows us create dictionary.1st key value 1 is stores the value ; in next line we see that overwrite the value with 2 where key value =1. next key value=1.0 is stores the value 4.

for loop is created to sum of all dictionary value.

so sum valu is = 6

Similar questions
Economy, 9 days ago