1, list-list
A list is an ordered set of elements that you can add and delete at any time.
Lists all elements in the array num:
Access the elements in the list, the index starts at 0, 0 is the first element, and when the index is out of range (this case index is greater than 9 o'clock), the index cannot cross, and the last element's index is Len (num)-1 (Len ()). You guess)
If you want to take the last element, in addition to calculating the index position, you can also use-1 to index directly to the last element (bottom one)
Use append () to add elements at the end of the list
Use Insert () to add element inserts to the specified location
Use Pop () to delete the last element of the list
Using Pop (i) where I is the index number, you can delete the element at the specified location
To replace an element, you can assign a value directly to the element that corresponds to the index number position
The element types in the list can be different (as can be seen from the example above), and not only that, but also its elements can be another list
2, tuple
Tuple is a sequence table, which is very similar to the list, but (but not all of it is nonsense)
Tuple can not be modified once initialized, and there is no append () of these methods to get the element but not assign it to another element
If you want to define an empty tuple can be written ()
If you define 1 elements. (1) write like this.
NoNoNo
Define an element to do this (1,) to add a comma oh
(1) This represents the number 1, is the number of
Tuple how to change the elements inside.
It's not that tuple can change, but that the elements in the list that tuple point to can change
Tuple ()
Lis T with []