Lists and tuples

--Originally published at codemathblog.wordpress.com

See this:

list terminal

 

A list is a set of data (any kind, it can be strings, integrers, booleans). And a tuple? is the same, the only difference is that you can alterate the data from de list and what is in the tuple will remain the same foreva’

And that’s all? You can manage lists doing stuff but not tuples, for example:

Iappends

Using the function .append we are adding to our list a new value, that would print “1,2,3,4,5,44”

And if we want to do the same with a tuple it will be an error

errror

So, you can alterate a list but not a tuple,

I hope it was useful:

 

If you want to learn more about lists use see this:

https://www.tutorialspoint.com/python/python_lists.htm