What is the purpose of 'list' function before the filter function?
# Program to filter out only the even items from a list
my_list = [1, 5, 4, 6, 8, 11, 3, 12]
new_list = list(filter(lambda x: (x%2 == 0) , my_list))
print(new_list)
Read more here: https://stackoverflow.com/questions/65708587/what-is-the-purpose-of-list-function-before-the-filter-function
Content Attribution
This content was originally published by MP5 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.