Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python for loop practice problems

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']
 
PREVIOUS NEXT
Tagged: #python #loop #practice #problems
ADD COMMENT
Topic
Name
9+8 =