Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
//Python's standard out is buffered (meaning that it collects some of the data "written" to standard out before it writes it to the terminal). Calling sys.stdout.flush() forces it to "flush" the buffer, meaning that it will write everything in the buffer to the terminal, even if normally it would wait before doing so.
17th Mar 2019, 7:20 PM
Sudarshan Rai
Sudarshan Rai - avatar