摘要:
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 >>> 阅读全文
摘要:
1. 向列表的尾部添加一个新的元素 append(...) L.append(object) -- append object to end 1 2 3 4 >>> a = ['sam',24,'shaw'] >>> a.append('35') >>> a ['sam', 24, 'shaw', 阅读全文