List element case conversion

Question:

I have a list that has 12 elements. I am getting an input and matching that input with the value of another variable. Now that means that case-sensitivity will be a problem. I know how to go through the list with a loop but how can I convert every character in each element to a lowercase character?

for i in sa:  
    # something here to convert element in sa to lowercase
Asked By: Hrittik Chatterjee

||

Answers:

A simple one liner:

lowercase_list = [ i.lower() for i in input_list ]
Answered By: amitchone
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.