Like understanding a list, but a little different.
This is a map .
lst = ["Red", "Green", "Blue"] new_lst = map(lambda x: (x.upper(), x, ""), lst)
It basically modifies each item in the list one by one according to the function you entered as the first parameter. What in this case:
lambda x: (x.upper(), x, "")
If you have no idea what lambda is , it almost looks like high school math:
f(x) = (x.upper(), x, "")
source share