摘要:
1.清空字典中元素清空,dict变为{} L.clear()-> None. Remove all items from L 1 2 3 4 >>> L ={'shaw':23,'sam':36,"eric":40} >>> L.clear() >>> print L {} 1 2 3 4 >>> 阅读全文
posted @ 2016-05-16 17:00
opsedu
阅读(377)
评论(0)
推荐(0)
摘要:
1. 向列表的尾部添加一个新的元素 append(...) L.append(object) -- append object to end 1 2 3 4 >>> a = ['sam',24,'shaw'] >>> a.append('35') >>> a ['sam', 24, 'shaw', 阅读全文
posted @ 2016-05-16 13:26
opsedu
阅读(374)
评论(1)
推荐(0)