I am starting to learn python and I just came across filter(). however, I got a question about what happens when u use filter() in python
so when I use filter, no error occurs:
then I tried asking myself why must I use filter() n not just write a function with a loop for each line of the friends list and appends an empty list whenever someone is above 18, so I did this
found out that it gives me an error so I thought it was a problem with my function, so I tried it with my lambda function that works with my filter() and it still gave me an error
enter image description here
so now I am very confused and have totally no idea why filter() allows me to do it but without it I can’t use the >= operator with tuples
sorry in advance if I am asking an illogical question and thank you!