Lists

--Originally published at Just A Turtle Coding.

What does a list means? Basically Python has a type of data that’s named list that’s closely related to a tuple. It is basically the same but we use [] instead of (). The only difference is that a list can be modifiable “on-the-go”. 

A list can be created by typing the name and adding some values, it will be indexed starting from 0

Let’s say that my friends are called Juan Pancho and Roberto

friends = [”Juan”,”Pancho”,”Roberto”]
then Juan would be 0, Pancho 1 and Roberto 2.
If I call to print friends[1], it would return Pancho.

I could also say that friends[1] = Paco, that would modify the value of Pancho and change it to Paco instead.

More info on: http://sthurlow.com/python/lesson06/