向列表中添加元素
1.append
tabulation1.append('紫霞')
['大聖', '天蓬', '卷簾', '紫霞', '紫霞', '青霞']
2.insert
tabulation1.insert(1,'紫霞') ['大聖', '紫霞', '天蓬', '卷簾', '紫霞', '紫霞', '青霞']
出處:https://www.jb51.net/article/131400.htm
python尋找list中最大值、最小值並返回其所在位置
c = [-10,-5,0,5,3,10,15,-20,25] print c.index(min(c)) # 返回最小值的位置 print c.index(max(c)) # 返回最大值的位置