Answers for "modify a list with for loop function in python"

0

modify a list with for loop function in python

cities = ['new york city', 'mountain view', 'chicago', 'los angeles']

for index, value in enumerate(cities):
    cities[index] = value.title()

print(cities)

# output - ['New York City', 'Mountain View', 'Chicago', 'Los Angeles']
Posted by: Guest on February-07-2022

Code answers related to "modify a list with for loop function in python"

Python Answers by Framework

Browse Popular Code Answers by Language