python中len是什么

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

len()方法语法:

复制代码
len( str )

返回值:

返回字符串长度。

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

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

以上实例输出结果如下:

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