The filter() method filters the given sequence with the help of a function that tests each element in the sequence to be true or not.
filter(function, sequence)
function: function that tests if each element of a sequence true or not.
sequence: sequence which needs to be filtered, it can be sets, lists, tuples, or containers of any iterators.
Returns: returns an iterator that is already filtered.
python main.py
Darshil Aslaliya
GitHub : darsh-22
Mail : [email protected]