Answers for "capiatlize first letter in list"

0

how to capitalize the first letter in a list python

singers = ['johnny rotten', 'eddie vedder', 'kurt kobain', 'chris cornell', 'micheal phillip jagger']
    singers = [singer.capitalize() for singer in singers]
    print(singers)

   #instead of capitalize use title() to have each word start with capital letter
Posted by: Guest on April-19-2020
0

capiatlize first letter in list

singers = ['johnny rotten', 'eddie vedder', 'kurt kobain', 'chris cornell', 'micheal phillip jagger']
    singers = [singer.capitalize() for singer in singers]
    print(singers)

   #instead of capitalize use title() to have each word start with capital letter
   
   Output:

   Johnny rotten, Eddie vedder, Kurt kobain, Chris cornell, Micheal phillips jagger
Posted by: Guest on June-11-2021

Browse Popular Code Answers by Language