Can you sort a dictionary python?



Can you sort a dictionary python?..

Answer / Gaurav Dwivedi

Yes, you can sort a Python dictionary by its keys or values. Use the sorted() function with a key parameter to specify which element to sort.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Explain me what is python and explain some of its benefits?

1 Answers  


How to make any variable private in python ?

1 Answers  


Tell me what is pickling and unpickling?

1 Answers  


What are objects and classes in python?

1 Answers  


Is python better than java?

1 Answers  


What does this mean: *args, **kwargs?

1 Answers  


Consider multiple inheritances here. Suppose class c inherits from classes a and b as class c(a,b). Classes a and b both have their own versions of method func(). If we call func() from an object of class c, which version gets invoked?

1 Answers  


Why python is a dynamic language?

1 Answers  


How is python interpreted?

1 Answers  


What is tuple play?

1 Answers  


What is a private method?

1 Answers  


How do you include a module in your python file?

1 Answers  


Categories