1.

Which of the following isn’t true about dictionary keys?(a) More than one key isn’t allowed(b) Keys must be immutable(c) Keys must be integers(d) When duplicate keys encountered, the last assignment winsI have been asked this question in a job interview.My enquiry is from Dictionary topic in section Dictionary, Functions and Built-in Functions of Python

Answer» CORRECT option is (c) Keys must be integers

Easiest explanation - Keys of a DICTIONARY may be any DATA type that is IMMUTABLE.


Discussion

No Comment Found

Related InterviewSolutions