python中len是什么

371次阅读
没有评论

python中len是什么

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

len()方法语法:

len( str )

返回值:

返回字符串长度。

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

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

以上实例输出结果如下:

字符串长度: 32
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-06-24发表,共计175字。
新手QQ群:570568346,欢迎进群讨论 Python51学习