I have just started the course HDPCD Spark using Python. I am taking up the Udemy Course taught by Durga Sir. In the lecture number 27, Section 4, he has the following lines of code:
def isComplete(order, ordersCompletedCount):
isCompleted=order.split(",")==“COMPLETE” or order.split(",")==“CLOSED”
ordersFiltered=orders.filter(lambda order :isComplete(order,ordersCompletedCount))
Now, when he is issuing the statement: ordersFiltered.count(), it is giving the count of the orders satisfying the condition. My question is the function isComplete is returning a boolean value, then how come the variable ordersFiltered gets the count? Also how the lambda function operates in this case?