Ad
  • Custom User Avatar

    I think your int-str conversion is useless.

    What filter does is filtering out the items which do not satisfy the prerequisite(the lambda) in a.

    The process is:
    filter picks the items in a one by one and tests them by the lambda expression.
    Each time, lambda accepts one item and returns a boolean value, filter will keeps down the item if lambda returns True or drops it while False.

    The items returned from filter are picked from a directly(but not returned by lambda) and the lambda expression should always returns boolean value.