From both data types, we can access elements by index and we can iterate over them. To define a tuple, we just need to replace the brackets with parentheses () like this: numbers = (1, 2, 3). We can define a list using square brackets like this: numbers =. Let’s start by comparing the tuple ( immutable) and list ( mutable) data types.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |