In a simple program to test math skills, I have the line
print('How much is '+str(number1)+' x '+str(number2)+'?', end="\n");
which works fine. But then the answer is typed on the next line. To be able to type right after the question I used end=" "
and end="\t"
. But then if I run this line for a number of sums, the first question is never printed. After the first answer it goes fine.
Posts about other online Python interpreters (e.g., PyCharm) suggest that it may be a flushing issue, and that adding flush=True
to the print
statement or the line sys.stdout.flush();
after it will make it print. But in PythonAnywhere that is not the case.
Does anyone now a solution for this?