Level II
Play with lists
Until here you’ve learned how to deal with variables and play with and among them. How to remember all the variables you’ve used? This is very annoying right? That’s why there are some structures that allow you to store several values in one.
Let’s start with the lists!
As you have seen in the examples, in order to create a list, you need to add the information you want between square braces [ ]. It can be a list of anything you like; of strings, of numbers of any type, or even of variables that are, indeed, lists. Also, the values stored in the same list do not need to be of the same type. A list can contain strings and integers at the same time, for instance.
The tlf4 list in the example is an empty list, and it works too! Imagine you save the contact info without the number, it can happen right?
Previous level
Play with logic expressions
Next lesson
Access the elements of a list