Python3 List len()方法
Python 3 教程
· 2019-02-06 11:13:28
描述
len() 方法返回列表元素个数。
语法
len()方法语法:
len(list)
参数
- list -- 要计算元素个数的列表。
返回值
返回列表元素个数。
实例
以下实例展示了 len()函数的使用方法:
#!/usr/bin/python3 list1 = ['Google', 'Codercto', 'Taobao'] print (len(list1)) list2=list(range(5)) # 创建一个 0-4 的列表 print (len(list2))
以上实例输出结果如下:
3 5
点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html
Elements of Information Theory
Thomas M. Cover、Joy A. Thomas / Wiley-Blackwell / 2006-7 / GBP 76.50
The latest edition of this classic is updated with new problem sets and material The Second Edition of this fundamental textbook maintains the book's tradition of clear, thought-provoking instr......一起来看看 《Elements of Information Theory》 这本书的介绍吧!