Python-week3 (based on Python3.0 or above ),
1. tuples
Tuples are similar to lists. The biggest difference is that you cannot modify them. Therefore, you can call them unmodifiable lists.
Brackets are used in the list, and parentheses are used in the tuples. All are separated by commas.
It is worth noting that when creating a tuples with only one element, you must add a comma after the element, such as tup = (2 ,). Therefore, we can see that the basis for determining tuples is comma rather than parentheses.
2. Access operations such as tuples
1. Similar to the list string, tuples also access the elements in the table below.
2. You can also intercept it.
3. The tuples cannot be modified, but we can combine them using operators.
4. Delete tuples using the del Method
The above is not an example. This is just my notes, summary, not a tutorial. You can search for many tutorials on the Internet, which is clearer than me. If you have any errors, please correct them. Thank you!