Which of the following data types in Python is used to store key-value pairs?
A. Dictionary
B. List
C. Tuple
D. Set
Answer: Option A
Related Questions on Dictionary in Python
Which of the following data types in Python is used to store key-value pairs?
A. Dictionary
B. List
C. Tuple
D. Set
A. setdefault()
B. addkey()
C. insert()
D. newkey()
What does the len() function do when applied to a dictionary?
A. Returns the number of key-value pairs in the dictionary
B. Returns the sum of all values
C. Returns the length of the longest key
D. Returns the length of the longest value
In Python, how can you get a list of all key-value pairs in a dictionary?
A. items()
B. get_items()
C. all_items()
D. list_items()
Join The Discussion