Home »
MCQs »
Python MCQs
The following is used to define a ___
19. The following is used to define a ___.
d = {
<key>: <value>,
<key>: <value>,
.
.
.
<key>: <value>
}
- Group
- List
- Dictionary
- All of the mentioned above
Answer: C) Dictionary
Explanation:
With the help of curly braces (), we can define a dictionary that contains a list of key-value pairs that are separated by commas. Each key and its associated value are separated by a colon (:). For example:
d = {
<key>: <value>,
<key>: <value>,
.
.
.
<key>: <value>
}