Grouping Values

Now, we'll learn how to store multiple values together.

We'll cover the following

In Python, we can store multiple values together in a single variable. While there are many ways of doing so, the most popular is the list.

It is very similar to a string since a string is a collection of characters. A list is also just a collection of values. However, the values can be of any type.

All we have to do is enclose all the elements in square brackets, [], and separate them with commas.

Making a List #

Get hands-on with 1200+ tech skills courses.