学堂 学堂 学堂公众号手机端

可以使用len()函数来判断字符串的长度,示例如下: string="Hello,World!" length=len(string) print("Thelengthofthestringis:",length) 输出结果为: Thelengthofthestringis:13

lewis 1年前 (2024-03-17) 阅读数 4 #技术

可以使用len()函数来判断字符串的长度,示例如下:

string="Hello,World!"
length=len(string)
print("Thelengthofthestringis:",length)

输出结果为:

Thelengthofthestringis:13

版权声明

本文仅代表作者观点,不代表博信信息网立场。

热门