How to make the elements in a list of strings uppercase in Python

Every element in a list of strings can be converted into uppercase. For instance, [“A”, “b”, “c”] can be converted into [“A”, “B”, “C”].

Solution for How to make the elements in a list of strings uppercase in Python : You can use str.upper() to convert every element in a list of strings into uppercase Use a for loop to iterate through each element in a list of strings by index. Call str.upper() on each string and reassign it to the corresponding index in the list for that string.

Use a list comprehension for a more compact implementation.

string_list = ["A", "b", "c"]


how-to-make-the-elements-in-a-list-of-strings-uppercase-in-python