Python Dictionaries All Notes

HKN MZ
3 min readJun 28, 2021

Dictionaries are used to store data values in key:value pairs.Key value is provided in the dictionary to make it more optimized. Dictionaries are written with curly brackets, and have keys and values. Dictionaries are mutable. We can add new items or change the value of existing items.

Create an Dictionary elements

# empty dictionary
my_dict = {}
# dictionary with integer keys
my_dict = {1: 'apple', 2: 'banana', 5: [2, 4, 3] }
# dictionary with string keys
my_dict = {'apple': 3, 'banana': 5, 'list'

--

--

HKN MZ

I am writing about Sql Server, Elasticsearch and Python. İ am an Database Administrator on SQL Server and Elasticsearch more than 5+ years.