A

Admin • 833K Points
Coach

Q. How to sort a dictionary by its keys?

  • (A) sorted(dict)
  • (B) dict.sort()
  • (C) sorted(dict.items())
  • (D) sort(dict)

Explanation by: Admin

`sorted(dict.items())` returns a list of sorted key-value pairs.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.