1

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
  • Hi and welcome to stack overflow ... people generally like to see some effort on behalf of the question asker( this is usually in the code example of what they have tried so far, and an explanation of why it did not work and what the actually expected output is) – Joran Beasley Oct 15 '18 at 23:53

1 Answers1

1

A simple one liner:

lowercase_list = [ i.lower() for i in input_list ]
amitchone
  • 1,630
  • 3
  • 21
  • 45