Question:medium

Which of the following built-in function/method returns a dictionary?

Show Hint

Use dict() to build a new dictionary,
and use keys(), values(), and items() to access parts of an existing one.
Updated On: Jan 14, 2026
  • dict()
  • keys()
  • values()
  • items()
Show Solution

The Correct Option is A

Solution and Explanation

The built-in dict() constructor in Python generates a new dictionary object. This constructor accepts key-value pairs or other mappings to form the dictionary. Methods like keys(), values(), and items() operate on an existing dictionary but do not create a new one. Specifically, keys() provides a view of the dictionary's keys, values() returns a view of its values, and items() returns a view of its key-value pairs as tuples. Only the dict() function is responsible for the actual creation and return of a dictionary object. Consequently, option (A) is the correct choice.
Was this answer helpful?
0