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
ANSI Common Lisp
Paul Graham / Prentice Hall / 1995-11-12 / USD 116.40
For use as a core text supplement in any course covering common LISP such as Artificial Intelligence or Concepts of Programming Languages. Teaching students new and more powerful ways of thinking abo......一起来看看 《ANSI Common Lisp》 这本书的介绍吧!
URL 编码/解码
URL 编码/解码
UNIX 时间戳转换
UNIX 时间戳转换