** Title: ** List examples.Copy the code
#list  
# Create new list
testList=[10086.China Mobile[1.2.4.5]]  
  
# Length of access list
print (len(testList)  )
# to the end of the list
print (testList[1:)# Add an element to the list
testList.append('i\'m new here! ')  
  
print (len(testList)  )
print (testList[-1])The last element in the popup list
print (testList.pop(1))print (len(testList)  )
print (testList  )
#list comprehension  
# after the introduction, temporary skimming
matrix = [[1.2.3],  
[4.5.6],  
[7.8.9]]  
print (matrix  )
print (matrix[1]  )
col2 = [row[1] for row in matrix]#get a column from a matrix
print (col2  )
col2even = [row[1] for row in matrix if  row[1] % 2= =0]#filter odd item  
print (col2even)
Copy the code