已知一个列表中有很多单词,请把所有单词变成小写,用python实现
时间: 2024-05-14 12:13:35 浏览: 82
可以用Python中的列表推导式和字符串的lower()方法实现:
```
words = ["Hello", "WORLD", "PythoN", "LISt"]
lower_words = [word.lower() for word in words]
print(lower_words)
```
输出:
```
['hello', 'world', 'python', 'list']
```
阅读全文