Lab One

Exercise 2
Type the following statements in the Python interpreter to see what they do:
5
x = 5
x + 1

Screen Shot 2013-09-23 at 7.01.21 PM

 

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.

 

Screen Shot 2013-09-29 at 10.53.37 AM

The output was a “syntax error.”

 

Screen Shot 2013-09-29 at 11.00.50 AM

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.

Leave a Reply

Your email address will not be published. Required fields are marked *