0 votes
in Python by
What is a dictionary in pthon?

1 Answer

0 votes
by

Dictionary is a data structure as well as a data type in python.It is enclosed in curly brackets{}.

Dictionary contains 2 elements – key and value

key is a string for us to grab a value.

Example

dictionary = {

‘a’: 1,

‘b’: 2

}

print(dictionary[‘b’])

...