# Define a list of words
words = ['hello', 'world', 'python']
# Use list comprehension to convert words to uppercase
uppercase_words = [word.upper() for word in words]
code
Convert Words to Uppercase in List Comprehension
This Python code uses list comprehension to create a new list (uppercase_words) where each word from the original list (words) is converted to uppercase. The comments provide explanations for each part of the code.
List comprehension
Uppercase Conversion