you should not modify
numbers
while iterating over itnumbers = [2,8,6,12,13,9,5] odd_numbers = [] for number in numbers: if number % 2: # number is odd odd_numbers.append(number) print(odd_numbers)or simply
numbers = [2,8,6,12,13,9,5] odd_numbers = [number for number in numbers if number % 2] print(odd_numbers)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs