Canopy

Canopy shows the syntax errors in your code and  examples are described below. (The latest release of Canopy provides an Interactive Graphical Python Debugger. See https://www.enthought.com/products/canopy/canopy-python-debugger/)

Examples of syntax errors

Your student  failed to place a colon(:) in the if-statement as required. Canopy underscores the error statement with a red line.

image007

If the  student ignores the red line and runs the code, the error message below is produced. It tells the student that the error is in line 2 and it is a syntax error.

image008

We add the missing colon. Now, the print statement has a red line!   Why?

image009

Maybe we don’t see why and run the code.  This will produce the error message below. It tells you that the error is in line 3 and there should be an indented block.

image010