Jun-11-2020, 08:31 PM
I actually initially jumped into this exercise writing a regular for loop and came up with something slightly different (but created the same result) to what you came up with, @knackwurstbagel:
Sharing alternate script solutions with someone else helps. So thank you, @knackwurstbagel, @menator01, and @bowlofred
def filtering(numbers): for num in numbers: if num <= 0: continue if num % 2 == 0: list_of_numbers.append(num) else: continue return list_of_numbersMine is a little less elegant, but after I came up with that, I then proceeded to achieve the same result with list comprehension (or almost).
Sharing alternate script solutions with someone else helps. So thank you, @knackwurstbagel, @menator01, and @bowlofred