Python Programming Language Lists Tutorial

Jesse L
5 min readAug 16, 2021

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

Lists

We can create an empty list by using square brackets:

list = []

We can create a list and populate it by adding values within the square brackets:

list = ["item1", "item2", "item3"]

As you can see I added three string items into my list and each item in my list is separated by a comma. We can print our list to see what it looks like:

list = ["item1", "item2", "item3"]
print(list)
Output
['item1', 'item2', 'item3']

Python has 4 different basic built in data structures. They are lists, tuples, dictionaries, and sets. Each one has different uses for different situations. Lists are mutable, ordered, and allows duplicate values.

How do you get values from within a list? A list uses indexing which allows us to refer to items in the list by index number. Take note that the first value…

--

--

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.