Answers for "how to capitalize first letter in python in list using list comprehension"

0

how to capitalize first letter in python in list using list comprehension

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

how to capitalize first letter in python in list using list comprehension

my_list = ['apple pie', 'orange jam']
print my_list[0].capitalize()
Posted by: Guest on May-30-2020

Code answers related to "how to capitalize first letter in python in list using list comprehension"

Python Answers by Framework

Browse Popular Code Answers by Language