Adding Print Statements

The goal of this stage of learning about programming is to develop a mental model of how the program works. Can you look at a program and predict what’s going to happen? Can you figure out the values of the variables? Feel free to insert lots of print() function calls. Make a prediction about variable values, then insert print() calls to display the variable values, and run the program to find out whether the prediction is right. Run this version to see what gets printed.


Discuss topics in this section with classmates.

Show Comments
You have attempted of activities on this page