anonymous
  • anonymous
Is it necessary that the two or more keys in a dictionary in python can't have duplicate values. . ?? is this allowed: dict={'a':1,'b':2,'a':5}
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
it will not throw an exception but, dict['a'] will return 5. After running dict={'a':1,'b':2,'a':3}, dict ={'a':3,'b':2}.
anonymous
  • anonymous
It's a random process. . if u do dict['a'] u can either get the output as 1 or 3. . Alrt So u mean to say we can have duplicate keys for different values
anonymous
  • anonymous
I beleive that the 'a':3 part of the initialization just sets 'a' to 3. This is what I got typing in Idle. >>> d={'a':1,'b':2,'a':3} >>> d {'a': 3, 'b': 2}

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
ohk thank u :)

Looking for something else?

Not the answer you are looking for? Search for more explanations.