#Mastery17

Lists and Tuples

It is common to confuse both as they can be used to store a collection of items, but there is a difference. Lists are mutables and tuples are immutables.

Examples. Lists:

As you can see it is ordered as you wrote it.

In this case you can see that we you write strings you use ‘asd’

Examples. Tuples:

Here is another example of how to use tuples:

References:

https://realpython.com/python-lists-tuples/

https://www.afternerd.com/blog/difference-between-list-tuple/

Dejar un comentario

Diseña un sitio como este con WordPress.com
Comenzar