How can i repaint the output in one cell

This is a Python question and not a Jupyter question.
(Hint: Maybe initialize a list and store the values there and then when the loop is done, print the list?)