Python3 List clear()方法
Python 3 教程
· 2019-02-06 14:29:21
描述
clear() 函数用于清空列表,类似于 del a[:]。
语法
clear()方法语法:
list.clear()
参数
- 无。
返回值
该方法没有返回值。
实例
以下实例展示了 clear()函数的使用方法:
#!/usr/bin/python3
list1 = ['Google', 'Codercto', 'Taobao', 'Baidu']
list1.clear()
print ("列表清空后 : ", list1)
以上实例输出结果如下:
列表清空后 : []
点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html
Ajax for Web Application Developers
Kris Hadlock / Sams / 2006-10-30 / GBP 32.99
Book Description Reusable components and patterns for Ajax-driven applications Ajax is one of the latest and greatest ways to improve users’ online experience and create new and innovative web f......一起来看看 《Ajax for Web Application Developers》 这本书的介绍吧!