Lists
Let's look at the list data type in more detail.
We'll cover the following...
Definition
A list is a sequence of values enclosed in square brackets. It is extremely versatile as you can store multiple items of different data types inside of it. A list can also be treated as if it were an array.
Press + to interact
my_list_emp = [] # empty listprint(my_list_emp)my_list_int = [8, 9, 10] # list of integersprint(my_list_int)my_list_ftr = [1.25, 3.45, 6.12] # list of floatsprint(my_list_ftr)my_list_mixed = ["Buckle", 2, "Shoes"] # list of mixed data typesprint(my_list_mixed)
Indexing
Lists are also zero-indexed, meaning the first item in the list is assigned an index of 0.
Therefore, if for example, a list called my_list
...