How to convert list items to uppercase using list comprehension in Python

1 Answer

0 votes
words = ['python', 'java', 'php']

words = [x.upper() for x in words]
 
print(words)



'''
run:

['PYTHON', 'JAVA', 'PHP']

'''

 



answered Aug 22, 2019 by avibootz
...