Hello, in this video we are going to look at lists in Python lists are just like really amazing more compound data types. And a list does contain several items. And they're separated by commas. And they're usually contained within square brackets. And the values in the list can easily be accessed using something called a slice operator. And based on indexing the one we're going to cover all of that, first of all, let's actually create a list.
So I'm gonna call it list. And again, this equals assignment operator with square brackets, I would like to close it, I mean open ended first and then put it inside the quotation marks. And we could put a string in here for let's say, Hello. We could put a number here so 45 for another string of hello world. Destiny Follies. I don't think that's enough.
You get the picture of how to add them and print off some lists, so let's just print it off as it is. So, not accessing it in any particular element. Click Run. So submission is queued. This shouldn't take too long, just a few seconds. And it's missing, missing parentheses in call to print.
Running again. Okay, so it's printed off all of our list and How would we pay off a single element? As I mentioned before, pretty much everything in computer science, including programming started with zero, so the first element will be zero. So if I put in 00, and I'll do another print or put, say free, so that'll be the fourth element because it's starting zero, so it's just n, which is the number we provide plus one, so 1234 so it can print off this right here. And we can also print elements, you know, all at once and know what to do print, no 02. So this basically prints the elements starting at you know, the first one to the third one.
And as you saw in the previous video with the variable types, with the string, you can also print off the rest of the data and also To start an index, just put Cola, and you'll print it off till the end. So I want you to do that as an expert. I've got one thing that he meant to specify the list itself, then square brackets. And this is the slice operator that would have given us we'll get some square brackets. Now, what you can also do is let's say if I were to fly by eight, it would print out the list eight times. So that's really cool as well.
And when you can also do is concatenate lists. So if you have two lists, add them together, you can cut concatenate them. So the awesome list on concatenate is not putting them together all at once. So again, do as an extra task. We're just going to use these four lines and run it and see what we get. And there we go.
Hello 4.5 it printed off the elements as well. So it's not included in the final massage the end point, but it doesn't include that one. So it's something to bear in mind. That's it for left. Thanks for watching this Python video, and I'll see you in the next awesome programming tutorial.