阅读量:139
可以使用len()函数来判断字符串的长度,示例如下:
```python
string = "Hello, World!"
length = len(string)
print("The length of the string is:", length)
```
输出结果为:
```
The length of the string is: 13
```
可以使用len()函数来判断字符串的长度,示例如下:
```python
string = "Hello, World!"
length = len(string)
print("The length of the string is:", length)
```
输出结果为:
```
The length of the string is: 13
```