Question: Consider this Python program: count = 3 while ( count < 1 0 ) : print ( count ) count = count + 1 Tracing
Consider this Python program:
count
while count :
printcount
count count
Tracing the algorithm:
What values will the variable count take on as this repetition statement executes? Predict all the values of count without executing the program in the Python shell.Be the computer and run the program in your mind.
Since this program is really simple and theres only variable, well just list all the values on a single line separated by commas as we trace:
count
Executing the code:
Now write the instructions in a Python file and execute the program in the shell. Then record the observed output when running the software.
What values print to the screen?
Suppose we added a line to the program, like this:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
