r/PythonLearning • • Jul 11 '25

Code won't print

Post image

What's the error?(I'm a newbie)

115 Upvotes

86 comments sorted by

View all comments

1

u/initumX Jul 16 '25 edited Jul 16 '25

Not a good style (use if-else instead of just if), but it is correct and still should work. It should print 1 3 5 7 and 9. If you don't see, then may be you are using windows and console disappears immediately after starting and you can't see what it shows.

  1. You can add 3 sec delay this way:

2. Or run it from console like this: python yourPyFile