Python Tutorial-Lists

A lot of programming languages use Arrays. In Python they’re not called Arrays, they are called Lists. Lists in Python are very dynamic because you can manipulate what’s inside a list. Here’s how a List is set up.

This will output 4. Now you might need an explanation. We created a list of numbers 1 through 10 and then asked Python to print the number at index 3. Remember that Python starts indexing with 0 so the 4 is actually at index 3. Also notice we used [] for our List.

A list can contain integers or string, or even both but this is not a good practice. Now let’s combine a couple of tutorials.

Your output will be 1 2 3 4 5 6 7 8 9 10 and then 1 2 3 4 5 6 7 8 9 10 11.

That’s all for now…try out some of the methods. Have a blast.