Can dictionary have a duplicate keys ?



Can dictionary have a duplicate keys ?..

Answer / Rajeev Ranjan Jha

No, in Python dictionaries cannot have duplicate keys. If you try to add a key that already exists, the last value overwrites the previous one.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What are the types of variables in python?

1 Answers  


How will you merge two dictionaries in python?

1 Answers  


How does python sort work?

1 Answers  


Does python supports interfaces like in java or c#?

1 Answers  


What is raw_input in python 3?

1 Answers  


What is the difference between a shallow copy and deep copy?

1 Answers  


Is geany a good ide?

1 Answers  


Is python scripting easy to learn?

1 Answers  


What are the different ways to create an empty numpy array in python?

1 Answers  


How to get a random number in python?

1 Answers  


What is flatmap in python?

1 Answers  


Should I learn python or scala?

1 Answers  


Categories