python的lower函数如何使用
python的lower函数如何使用
lower()函数是Python中的字符串方法,它可以将字符串中的所有大写字母转换为小写字母。其语法以下:
```
string.lower()
```
其中,string是要转换的字符串。下面是一个简单的例子:
```python
s = "Hello, World!"
print(s.lower()) # 输出:hello, world!
```
在上面的例子中,我们将字符串s中的所有大写字母转换成了小写字母,并输出了结果。
文章来源:丸子建站
文章标题:python的lower函数如何使用
https://www.wanzijz.com/view/66654.html