What are the different ways to create a dictionary
Answers
Answered by
3
Answer:
A common way of creating dictionaries is the literal notation. The dictionary elements are specified within the {} brackets, separated by comma. The key and values are separated by colon. The example creates a dictionary of cities with literal notation.
how to create dictionary?
To create a Dictionary, use {} curly brackets to construct the dictionary and [] square brackets to index it. Separate the key and value with colons : and with commas , between each pair. As with lists we can print out the dictionary by printing the reference to it.
Explanation:
hope it's help you ☺️☺️☝️☝️✍️✍️✍️
Similar questions