python字符串转小写
时间: 2023-10-11 09:14:24 浏览: 31
可以使用字符串的 `lower()` 方法来将字符串转换为小写,例如:
```python
string = "Hello, World!"
lowercase_string = string.lower()
print(lowercase_string)
```
输出结果为:
```
hello, world!
```
相关问题
python 字符串转小写
请使用字符串的 `lower()` 方法将字符串转换为小写。以下是一个示例:
```python
string = "Hello World"
lowercased_string = string.lower()
print(lowercased_string)
```
输出结果为:
```
hello world
```
python 字符串大写转小写
在Python中,可以使用`lower()`方法将字符串中的大写字母转换为小写字母。以下是一个示例:
```python
string = "HELLO WORLD"
lowercase_string = string.lower()
print(lowercase_string)
```
输出结果为:
```
hello world
```
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)