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’])

Related questions

0 votes
asked Nov 8, 2022 in Swift by SakshiSharma
0 votes
asked Apr 24, 2022 in SAP ABAP by sharadyadav1986
...