1. Sequence
Python contains 6 built-in sequences- lists, tuples, strings, Unicode strings, buffer objects, xrange objects
2. General sequence operation
2.1 Index
Note: input () transforms the corresponding type according to the user input, and if you want to enter characters and strings, you must enclose them in quotation marks.
Raw_input () is converted into a character type regardless of the type of user input.
2.2 Shards
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
(1) numbers[:]
[1, 2, 3, 4, 5, 6, 7, 8, 9, ten] #整个列表
(2) Numbers[3:5]
[4, 5] #包括起始索引对应的元素, but excluding elements corresponding to the index
(3) numbers[-5:-3]
[6, 7] #注意索引的顺序
(4) numbers[3,3]
[] #空列表
(5) numbers[-5, 9]
[6, 7, 8, 9] #混合正负索引
(6) numbers[-20, 20]
[1, 2, 3, 4, 5, 6, 7, 8, 9, ten] #好像不存在index out of range issues
(7) Numbers[8,-8]
[] #索引区间为空
2.3 Sequence Addition
Note: Two sequences of the same type can be added
2.4 Multiplication
2.5 Membership: In
2.6 Length, min and Max values
Len ()--Returns the number of elements contained in the sequence
Min ()-the largest element in a sequence
Max ()-the smallest element in a sequence
3. List
4. Tuples
Python Basic Tutorials summarize the list of elements and tuples