how to lower case a list in python

Question:

I am trying to read a text file in jupyter notebook and fetch the unique words in the file.

I am reading that file as a list and then trying to apply lower case on it. But the .lower() function doesn’t work with a list. Please help with the same.

Asked By: Naveen Kumar

||

Answers:

With a list of values in val you can do this:

valsLower = [item.lower() for item in vals]
Answered By: Amorpheuses
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.