Q. Predict the output:


dct = {}

dct[1] = 1

dct['1'] = 2

dct[1.0] = 4

sum = 0

for k in dct:

    print(k, sum)

    sum += dct[k]

print (sum)



Answer =

1 0
1 4
6
>>>

2 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post