python 字符串转小写
时间: 2023-09-25 15:12:33 浏览: 28
请使用字符串的 `lower()` 方法将字符串转换为小写。以下是一个示例:
```python
string = "Hello World"
lowercased_string = string.lower()
print(lowercased_string)
```
输出结果为:
```
hello world
```
相关问题
python字符串转小写
可以使用字符串的 `lower()` 方法来将字符串转换为小写,例如:
```python
string = "Hello, World!"
lowercase_string = string.lower()
print(lowercase_string)
```
输出结果为:
```
hello, world!
```
python 字符串大写转小写
在Python中,可以使用`lower()`方法将字符串中的大写字母转换为小写字母。以下是一个示例:
```python
string = "HELLO WORLD"
lowercase_string = string.lower()
print(lowercase_string)
```
输出结果为:
```
hello world
```