Jun-11-2020, 04:09 PM
Not really sure what you are after but for the "None", this works.
numbers = list(range(-10, 11)) # numbers = [2, 4, 51, 44, 47, 10] # numbers = [0, -1, -3, -5] result = [] result.append([num for num in numbers if num % 2 == 0 or num <= 0]) print(result)
Output:[[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 2, 4, 6, 8, 10]]
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts