1. Home
  2. Data Science
  3. Python
  4. Which method is used to retrieve all keys from a…

Added 4 May 2024

Which method is used to retrieve all keys from a dictionary in Python?

  1. keys() Correct answer
  2. values()
  3. items()
  4. get()

Correct answer

A. keys()

17 views

MCQSEXAM

Explanation

The keys() method returns a view object that displays a list of all keys in the dictionary.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs