Exercise 2
Type the following statements in the Python interpreter to see what they do:
5
x = 5
x + 1
Now put the same statements into a script and run it. What is the output? Modify the script by transforming each expression into a print statement and then run it again.
The output was a “syntax error.”
The output was once again a “syntax error.”
Two exercises from the book were worked in this lab. The purpose was to input code using the Python IDLE and then to run code from a script. The lab was an exposure to some more basic programming code and to experience error messages produced after running incorrect code.