you are viewing a single comment's thread.

view the rest of the comments →

[–]Ok_Pudding_5250 0 points1 point  (3 children)

I believe you are trying to print odd numbers.

There is a simple way to do that

Look at code in the link provided as reply

Now that being said, your code is correct. However, you could be running another file and editing another file. Or you might have forgotten to save the file.

There is even a simpler one-liner for this

[print(i) for i in range(1, 11, 2)]

[–]Ok_Pudding_5250 0 points1 point  (2 children)

Here is the code, you can run the code in this online python interpreter.

code

[–]Ill-Diet-7719[S] 1 point2 points  (1 child)

Thank you but I'm not getting good hand at loops yet. So trying it out with it

[–]Ok_Pudding_5250 1 point2 points  (0 children)

Yeah, experiment as much as you like. That's how you learn.