python中len是什么

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

len()方法语法:

复制代码
len( str )

返回值:

返回字符串长度。

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

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

以上实例输出结果如下:

复制代码
字符串长度: 32
相关推荐
Tony Bai4 小时前
高并发后端:坚守 Go,还是拥抱 Rust?
开发语言·后端·golang·rust
wjs20244 小时前
Swift 类型转换
开发语言
前端小L4 小时前
贪心算法专题(十):维度权衡的艺术——「根据身高重建队列」
javascript·算法·贪心算法
方得一笔4 小时前
自定义常用的字符串函数(strlen,strcpy,strcmp,strcat)
算法
秃了也弱了。4 小时前
python实现定时任务:schedule库、APScheduler库
开发语言·python
Dfreedom.5 小时前
从 model(x) 到__call__:解密深度学习框架的设计基石
人工智能·pytorch·python·深度学习·call
weixin_440730505 小时前
java数组整理笔记
java·开发语言·笔记
weixin_425023005 小时前
Spring Boot 配置文件优先级详解
spring boot·后端·python
Xの哲學5 小时前
Linux SMP 实现机制深度剖析
linux·服务器·网络·算法·边缘计算
Thera7775 小时前
状态机(State Machine)详解:原理、优缺点与 C++ 实战示例
开发语言·c++