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.
You can add 3 sec delay this way:
2. Or run it from console like this: python yourPyFile
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.
You can add 3 sec delay this way:
2. Or run it from console like this: python yourPyFile