Search code examples
pythonlistloopslowercase

Converting list into lowercase


enter image description here I want to convert the list into lower case but my output converts the last index object into a list in lower case. where am i going wrong? must be a lame question but i am super new to coding.


Solution

  • Use list comprehensions.

        list = ['UPPER', 'UPPER', 'UPPER']
        list = [x.lower() for x in list]
        print(list)
        >>> ['upper', 'upper', 'upper']