Python 字符串长度

字符串长度

要获取字符串的长度,请使用 len() 函数。

实例

len() 函数返回字符串的长度:

a = "Hello, World!"
print(len(a))

亲自试一试