Lists & Tuples

--Originally published at Py(t)hon

It is time for us to learn about lists and tuples, this is a very simple topic. Both are sequence type data, referring to the way they behave, as a sequence. The elements that go inside the list and the tuple can be different kind, a string, a number, even another list or tuple.

The difference between them is that the list is between [ ] and can be modify and the tuple is between parenthesis () and can’t be modify.

An example:

[10, 20, 30, 40, 50]
["spam", "bungee", "swallow"]
(2, 4, 6, 8)
("two", "four", "six", "eight")
[("cheese", "queso"), ("red", "rojo"), ("school", "escuela")]

Here is a video for better understanding:

That’s all? #Pug#Lists&Tuples #ISC#TC101#Tec