Oct-04-2021, 05:18 PM
The code is confusing if write like this will most will figure what's going with a quick look.
def number_remove(x: int) -> int: if x not in (0, 1): return x my_tuple = (0,1,2,3,4,5,6) print(list(filter(number_remove, my_tuple)))
Output:[2, 3, 4, 5, 6]