【Python】Python3 字典 clear()方法
来源:互联网 发布:数据清洗包括什么 编辑:程序博客网 时间:2024/06/07 18:37
描述
Python字典clear()
函数用于删除字典内所有元素。
语法 clear()
方法语法:
dict.clear()
参数
- NA。
返回值
该函数没有任何返回值。
实例
以下实例展示了clear()
函数的使用方法:
dict = {'Name': 'Zara', 'Age': 7}print("dict字典长度:",len(dict))dict.clear()print("dict字典长度:",len(dict))
以上实例输出结果为:
dict字典长度: 2dict字典长度: 0
阅读全文
0 0
- 【Python】Python3 字典 clear()方法
- python 字典clear()方法
- 【Python】Python3 List clear()方法
- python中的字典clear方法
- python字典为什么要用clear方法
- 【Python】Python3 字典 copy()方法
- 【Python】Python3 字典 fromkeys()方法
- 【Python】Python3 字典
- Python 字典删除元素clear、pop、popitem
- Python中字典的增、删、创建、索引与字典方法clear,copy,formkeys,get,has_key,popitem,update
- python clear screen的方法
- 决策树c4.5(python3字典各种方法,map(),集合set()等,python树节点)
- python3之python的核心数据类型(字典)
- python字典比较方法
- python 字典 get()方法
- python 字典方法
- python字典方法
- python 字典 get方法
- vector怎么转换为cvseq?
- 算法题/第一个只出现一次的字符
- Kotlin 第七章:属性和字段
- cnki账号 中国知网 免费 入口 用户名 密码 国内外学术刊物数据库账号
- 队列同步器
- 【Python】Python3 字典 clear()方法
- 快速排序算法归纳总结-java
- html日期加减
- EventBus源码分析(二):编译库源码解析
- c#下DLL文件的封装以及调用
- 关于Android应用内多语言切换的问题
- Oracle Spatial中SDO_Geometry说明及Demo例子
- POJ 1276 Cash Machine
- 每天学习一个linux命令--lsof