Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

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

my_list = ['apple pie', 'orange jam']
print my_list[0].capitalize()
Comment

PREVIOUS NEXT
Code Example
Python :: migrate data django 
Python :: plt.annotate text size 
Python :: python f string 
Python :: python Correlation matrix of features 
Python :: python for loop with increment 
Python :: plot background color matplotlib 
Python :: pandas select a row 
Python :: remove duplicate columns python dataframe 
Python :: self-xss meaning 
Python :: python for k, v in dictionary 
Python :: remove empty space from string python 
Python :: how to check libraries in python 
Python :: dataframe plot histogram 
Python :: how to clear a list in python 
Python :: flask quickstart 
Python :: python list divide 
Python :: http client post python 
Python :: how to file in python 
Python :: delete database entry using name django 
Python :: python matplt 
Python :: convert text to speech in python 
Python :: Get files from S3 bucket Python 
Python :: discord py get all channels in guild 
Python :: str to tuple of float 
Python :: django filter by date range 
Python :: how to take input for list in python 
Python :: max of three numbers in python 
Python :: python how to draw a square 
Python :: french to english 
Python :: what does .shape do in python 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =