小白教程
所有教程
关于
Search
172.71.254.95
172.71.254.95
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Python3 att list len”的源代码
本页内容
下一节:
Python3_att_list_max
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:len(list)}}[[Category:python3 list|1]] = Python3 List len()方法 = [[python3 list|Python3 列表]] == 描述 == len() 方法返回列表元素个数。 == 语法 == len()方法语法: <sample title="" desc="" lang="python" hererun="1"> len(list) </sample> == 参数 == * list -- 要计算元素个数的列表。 == 返回值 == 返回列表元素个数。 以下实例展示了 len()函数的使用方法: <sample title="" desc="" lang="python" hererun="1"> #!/usr/bin/python3 list1 = ['Google', 'xiaoBai', 'Taobao'] print (len(list1)) list2=list(range(5)) # 创建一个 0-4 的列表 print (len(list2)) </sample> 以上实例输出结果如下: <sample title="" desc="" lang="python" hererun="1"> 3 5 </sample> [[python3 list|Python3 列表]]
返回至“
Python3 att list len
”。
下一节:
Python3_att_list_max