r/PythonLearning • u/Hunter_z39 • Sep 02 '25
Help Request HELP ME
why is this code is not working
'''
Task 3 — Odd numbers 1–19
Make a list of odd numbers from 1 to 19 (use a step).
Self-check: 10 numbers, all odd.
'''
odd_numbers = []
for value in range(1, 20, 2):
# Using step of 2 to get odd numb
odd_numbers.append(value)
if(odd_numbers % 2 == 0)
print(odd_numbers)
0
Upvotes
3
u/BranchLatter4294 Sep 02 '25
Try moving the print statement to inside the loop and having it print value. Get rid of the if statement. Then see what you have in your list.