How to create a list in Python tutorial for beginners.
One of the most important types of data in Python is called a list. In this video tutorial we are going to learn about Python Lists. A list is exactly what it sounds like: a collection of things that are in a certain order. In programming, we often need work with a lot of data at the same time, so lists are very important. They let us work with a lot of data at the same time.
So let’s create our first list. We create a list by giving it a name and assigning it to a group of things we want it to hold. This group of things is stored in between brackets, which look like this: [] and the items in a list are separated by commas.
Let’s create a list of fruits. We type the name of the list
fruits = and now we have to type the brackets []
Now we have created an empty list. Let’s add some string items to it.
So we enter, “Apple”, “Orange”, “Banana”, “Avocado” separated by commas.
We created a list named fruits that contains 4 strings. This is how it looks in the memory. We have a big container with the label “fruits”, that’s the list, to hold four string items.
Watch video How to create a List - Python for Absolute Beginners course online without registration, duration hours minute second in high quality. This video was added by user Programming With Nick 28 April 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 545 once and liked it 21 people.