SoFunction
Updated on 2024-11-19

Use Python to capitalize the first letter of each item in a list.

As shown below:

L = ['adam', 'Lisa', 'bart', 'Paul']
m=0
for i in L:
  L[m]=i[0].upper()+i[1:]
  m=m+1
for index, name in enumerate(L):
  print (index, '-', name)

The above article using Python to achieve the first letter of each item in the list will be capitalized is all I have shared with you, I hope to be able to give you a reference, and I hope that you will support me more.