Python has something called the dictionary. Explain using an example
Answer / Sharib Ahmad
A dictionary in Python is a collection of key-value pairs, where keys are unique and hashable objects, and values can be any type. Dictionaries in Python are created using curly braces `{}`.nExample:n```pythonndict = {n 'name': 'John',n 'age': 30,n 'city': 'New York'n}nprint(dict['name'])n```
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you find the type and identification number of an object in python?
What is __ main __ in python?
Explain docstring in python?
How do you exit a python script?
What is the difference between interpreted and compiled languages?
How do you clean pyc files?
How do you write code in python?
What is the key difference between a list and the tuple?
How do you protect python source code?
Are uuids sequential?
How do you create a list which is a reverse version on another list in python?
What is argument in a function?