主页
Python
Python - 列表推导式
demo_list_comprehension_upper
运行 ❯
×
更改方向
保存代码
更改主题
fruits = ["apple", "banana", "cherry", "kiwi", "mango"] newlist = [x.upper() for x in fruits] print(newlist)
['APPLE','BANANA','CHERRY','KIWI','MANGO']