zoukankan
html css js c++ java
Python len()方法
Python len()方法
描述
Python len() 方法返回对象(字符、列表、元组等)长度或项目个数。
语法
len()方法语法:
len
(
s
)
参数
s -- 对象。
返回值
返回对象长度。
实例
以下实例展示了 len() 的使用方法:
>>>
str
=
"
runoob
"
>>>
len
(
str
)
# 字符串长度
6
>>>
l
=
[
1
,
2
,
3
,
4
,
5
]
>>>
len
(
l
)
# 列表元素个数
5
查看全文
相关阅读:
*Basic Calculator
今天周末20190616,分享句喜欢的话,常用架构图
Python 面向对象 --- 类和对象
Python 面向对象(OOP)基本概念
Python 高级变量类型 --- 函数的进阶
Python 高级变量类型 --- 变量进级
Python 高级变量类型 --- 综合应用
Python 高级变量类型 --- 公共方法
Python 高级变量类型 --- 字典
Python 高级变量类型 --- 元组
原文地址:https://www.cnblogs.com/HITSZ/p/7102395.html
最新文章
[洛谷P1864] NOI2009 二叉查找树
DOM 搜索功能
DOM table添加删除
DOM table 隔行变色
文档碎片
DOM removeChild
DOM inserBefore createElement
DOM getByClass封装
DOM 对元素添加属性 setAttribute
DOM firstChild firstElementChiled
热门文章
DOM offsetParent
Java排序: Comparator vs Comparable 入门
*Binary Tree Upside Down
*LinkedIn 高频题 – K closest points
*Combination Sum
*Evaluate Reverse Polish Notation
前缀,中缀,后缀波兰表达式
*Text Justification
*Max Points on a Line
**Word Ladder II
Copyright © 2011-2022 走看看