The website pythontutor.com allows you to see a code running line by line. Despite its name, pythontutor also works for Java, C++, JS and others !
Go on this page, write your code, select the Python 3.6 version and click on Visualize execution.
Then click multiple times on Forward so that the programs runs one line at a time.
You'll see the print of the programs in the frame Print output.
You see the state of the memory at the right side of the screen below the text Frames.