- 60
- 0
- 约1.19万字
- 约 48页
- 2017-06-11 发布于湖北
- 举报
2.5 Dictionary Operations (7)Delete Del statement to remove a key and its value, or the entire dictionary Clear () method to delete all the elements in the dictionary Pop () method to remove and return the specified key elements. del a_dict[server] a_dict {database: blog, user: mark} a_dict.pop(database) blog a_dict {user: mark} a_dict.clear( ) a_dict { } del a_dict a_dict Traceback (most recent call last): File pyshell#103, line 1, in module a_dict NameError: name a_dict is not defined a_dict= {database: blog, server: db.diveintopython3.org, user: mark} 2.5 字典 (7)删除元素和字典 可以使用de
原创力文档

文档评论(0)