in Python by (32.2k points)
What is a dictionary in Python? Give an example

1 Answer

0 votes
by (32.2k points)

A Python dictionary is a collection of items in no particular order. Python dictionaries are written in curly brackets with keys and values. Dictionaries are optimised to retrieve value for known keys.

Example of Dictionary :

d={“a”:1,”b”:2}

Related questions

+1 vote
asked Feb 13, 2021 in Python by SakshiSharma (32.2k points)
0 votes
asked Nov 8, 2022 in Swift by SakshiSharma (32.2k points)
...