Why doesn't print() work in Visual Studio Code? [duplicate]

I'm trying to make a while True-loop that repeatedly prints a string:

from time import sleep
while True:
    sleep(1)
    print("test", end="")

But it doesn't print anything when running it with VSC. Running it with the IDLE works for me, a friend also tried it and for him, it's the other way round.

Why does this happen?


Solution 1:

This is a duplicate of Does "time.sleep()" not work inside a for loop with a print function using the "end" attribute?, the output needs to be forced using print("test", end="", flush=True)