Member-only story

Python Programming Language Dictionaries Tutorial

Jesse L
4 min readAug 17, 2021

--

Hi everyone, welcome back. In this tutorial, I will show how to perform basic tasks involving dictionaries in Python. A dictionary is a data structure in the Python language and it is capable of storing several items in a singular dictionary variable. Dictionaries are a built in data type in Python. We will go over dictionary related functions and how dictionaries can be manipulated in this tutorial.

Dictionaries

Python has 4 different basic built in data structures. They are lists, tuples, dictionaries, and sets. Each one has different uses for different situations. Dictionaries are mutable, could possibly be ordered, and does not allow duplicates. In Python 3.7, dictionaries are ordered, but in previous versions, dictionaries are unordered.

Dictionaries store items in key value pairs. Let’s create a dictionary and see:

dictionary = {
"month": "january",
"day": "1st",
"year": "2000",
}
print(dictionary)
Output
{'month': 'january', 'day': '1st', 'year': '2000'}

Take a look above. The keys are on the left and the values are on the right. “Month”, “Day”, and “Year” are the keys of dictionaries. “January”,
“1st”, and “2000” are the associated values to the keys in the dictionaries. Because of these key value pairs…

--

--

Jesse L
Jesse L

Written by Jesse L

Hi, I'm a passionate technology enthusiast and lifelong learner. Beyond my technical pursuits, I'm also passionate about sharing my enthusiasm with others.

No responses yet