Home > OS >  Converting list into lowercase
Converting list into lowercase

Time:10-07

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.

CodePudding user response:

Use list comprehensions.

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

  • Related