Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert list elements to uppercase python

>>> [x.lower() for x in ["A", "B", "C"]]
['a', 'b', 'c']
>>> [x.upper() for x in ["a", "b", "c"]]
['A', 'B', 'C']
Comment

change strings in a list to uppercase

>>> [x.lower() for x in ["A", "B", "C"]]
['a', 'b', 'c']
>>> [x.upper() for x in ["a", "b", "c"]]
['A', 'B', 'C']
Comment

how to convert list to all uppercase

#Capitalise list

c = ['Kenya','Uganda', 'Tanzania','Ethopia','Azerbaijan']

converted_list = [x.upper() for x in c]print(converted_list)print("Remember to clap :-)")
Comment

PREVIOUS NEXT
Code Example
Python :: django validators import 
Python :: python how to check in a list 
Python :: appending to a list python 
Python :: similarity index in python 
Python :: for loop example python 3 
Python :: re.match python 
Python :: compress excel file in python 
Python :: String search from multiple files 
Python :: django customize the user model 
Python :: python loop backwards 
Python :: np.exp in python numpy 
Python :: scaling pkl file? 
Python :: concact geodataframe python 
Python :: keras model save 
Python :: Character limit python system 
Python :: class indexing 
Python :: how change column strin of list data type to list 
Python :: eval function in python 
Python :: get mean using python 
Python :: extract coordinate values in xarray 
Python :: python sqrt 
Python :: marshmallow default value 
Python :: django redirect 
Python :: how to access items in a list 
Python :: python find if strings are anagrams 
Python :: matrix diagonal sum leetcode in java 
Python :: dash log scale 
Python :: torch print full tensor 
Python :: append a dataframe to an empty dataframe 
Python :: EOFError: EOF when reading a line 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =