📅  最后修改于: 2022-03-11 14:46:57.581000             🧑  作者: Mango
cities = ['new york city', 'mountain view', 'chicago', 'los angeles']
for index in range(len(cities)):
cities[index] = cities[index].title()
print(cities)
# output - ['New York City', 'Mountain View', 'Chicago', 'Los Angeles']