list:
using []ex:
a=[1,2,3]
+:
[1,2] +[3,4]
--> [1,2,3,4]
sort()
reverse()
get column from list:
ex:
a=[ [1,2], [3,4] ]
b=[ row[1] for row in a]
--> b= [2,4]
row[1] means second column
Hence, second column for each row
append:
tuple:
use ()
ex:
a= (1,2,3)
It is like list , but it is immutable
沒有留言:
張貼留言