Question #901

What is the length of the object below?
{True: 5, bool(1): 10}

As bool(1) evaluates to True and as dictionaries don't allow duplicates, Python understands {True: 5, bool(1): 10} as {True: 10} . Its length is 1. (stackoverflow.com/questions/63881237/python-dictionaries-...)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: