1、添加元素
>>> week = ["星期一","星期二","星期三","星期四","星期五","星期六"];
>>> week.append("星期日");
>>> week;
['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
>>>
2、修改元素
>>> month = ["一月","二月","三月","四月"];
>>> month[2] = "五月";
>>> month;
['一月', '二月', '五月', '四月']
>>>
3、删除元素
>>> year = [2001,2002,2003,2004,2005];
>>> year;
[2001, 2002, 2003, 2004, 2005]
>>> del year[-2];
>>> year;
[2001, 2002, 2003, 2005]
>>> del year;
>>> year
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
year
NameError: name 'year' is not defined
>>>