将一个列表中所有的单词首字母转换成大写。请完善代码。 ls = input().split(",") for i in range(len(ls)): ls[i] = ___①___ print(ls)
时间: 2023-06-04 20:08:30 浏览: 192
ls = input().split(",")
for i in range(len(ls)):
ls[i] = ls[i].capitalize() #答案:ls[i].capitalize()
print(ls)
阅读全文