I'm programming in python for almost 2 years and I found a really weird thing when watching some old code.
import random, sys, time
try:
while True:
print(' ', str(random.randint(100,999)), end='')
time.sleep(0.01)
except:
sys.exit()
Following the syntax of this code my program should print a space and a random number from 100 to 999 forever, but this isn't happening.
When I run this code nothing appear on the screen until I press CTRL-C, even removing the try statement din't change anything.
I tried changing console (Windows terminal, powershell and CMD) but nothing happened.
Can please someone help me out with this? Thanks