Creation and use of tuples in Python

Creation and use of tuples in Python

Now here’s an example of what a tuple looks like, it’s very similar to a list, but the difference is that you cannot edit tuples, that’s why it’s telling you that there is an error at the end, because in line 6 it’s telling the program to delete the first element of the list but since it’s a tuple you cannot edit it to not show you that element, you could of course create another tuple with only the desired elements since you cannot edit it. Also the tuple uses parenthesis instead of brackets like in a list.

Creation and use of tuples in Python

CC BY 4.0 Creation and use of tuples in Python by tywins is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.