python中len是什么

Python len() 方法返回字符串长度。

len()方法语法:

复制代码
len( str )

返回值:

返回字符串长度。

以下实例展示了len()的使用方法:

复制代码
#!/usr/bin/python
str = "this is string example....wow!!!";
print "字符串长度: ", len(str);

以上实例输出结果如下:

复制代码
字符串长度: 32
相关推荐
froginwe11几秒前
PHP 魔术常量
开发语言
古城小栈1 分钟前
Rust 的 validator 库
开发语言·后端·rust
froginwe113 分钟前
《Foundation 选项卡:设计与实现的深入探讨》
开发语言
C雨后彩虹9 分钟前
竖直四子棋
java·数据结构·算法·华为·面试
lsx2024069 分钟前
XSLT `<sort>` 标签详解
开发语言
古城小栈10 分钟前
Rust 的 redis-rs 库
开发语言·redis·rust
楚Y6同学19 分钟前
基于 Haversine 公式实现【经纬度坐标点】球面距离计算(C++/Qt 实现)
开发语言·c++·qt·经纬度距离计算
Lxinccode20 分钟前
BUG(20) : response.text耗时很久, linux耗时十几秒, Windows耗时零点几秒
python·bug·requests·response.text·response.text慢
智航GIS24 分钟前
11.2 Matplotlib 数据可视化教程
python·信息可视化·matplotlib
技术净胜28 分钟前
Python 操作 Cookie 完全指南,爬虫与 Web 开发实战
前端·爬虫·python