📜  如何在python代码示例中小写列表

📅  最后修改于: 2022-03-11 14:46:43.336000             🧑  作者: Mango

代码示例1
[x.lower() for x in ["A","B","C"]]
['a', 'b', 'c']

>>> [x.upper() for x in ["a","b","c"]]
['A', 'B', 'C']

>>> map(lambda x:x.lower(),["A","B","C"])
['a', 'b', 'c']
>>> map(lambda x:x.upper(),["a","b","c"])
['A', 'B', 'C']