Let's go through some common errors.
These are typical mistakes that programmers make,
so it would be helpful just to have seen some of
the error messages and how to recognize the problems and how to fix them.
So, one that we've already seen is forgetting a parenthesis.
Here, it tells us there's a syntax error,
it doesn't really know exactly what's wrong but
it tells us there's a syntax error on line six.
Whenever you see a syntax error,
you should always look on the line number that it says.
If everything looks right there,
you should really look on the lines above it.
In this case, we forgot to close the parenthesis on line five.
So, even though it says line six,
it's line six where the Python Interpreter realized there was a problem,
that is on line five where you really have the problem and where you should correct it.
We should add that parenthesis, and now it works.
Our next set of errors involve variable names.
The first thing to realize is that capitalization really matters.
In this case, we go to line three and on line three,
it tries to do capital turtle dot small turtle.
First thing to know is that,
capital turtle and small turtle are
two completely different variable names and small turtle is the name of this module.
In that module, you can find the turtle class.
So, we really need it to have small turtle dot capital turtle.
So, another example of a variable naming problem occurs
here and sometimes you got to watch out and we have a big window to draw in,
that there may be an error message down below.
In this case, the name right is not defined on line six.
You might look at this and say,
this is all just fine,
we're telling june to go right by 90 degrees.
That's not the correct way to say it.
We first have to mention the object and then the dot and then the method.
So, june should go right by 90,
not right dot june.
So, let's fix that.
Now, we get it without the error message.
Here's another variable naming problem.
We create a turtle named June and then we tell June to move right by 90,
again the error messages down
off the screen and it's saying June is not defined on line six.
So, we're telling June to go right,
there's no binding for the variable June.
There is a binding for the variable small j
june but this is a situation where our small j june,
capital J June, not the same variable and so we got that error.
Fix that, no more error there.
Another common type of error is when we invoke
a function but don't pass in the right values,
the right arguments that it's expecting.
So here, we've got a program
where June is supposed to move forward and turn right and do that repeatedly.
But we didn't tell it how many times to do it,
so we invoked the range function but we didn't pass in
an argument saying how many times to do it.
We get an error and it tells us that on line five,
we tried to invoke the range function.
It wanted to have at least one argument but we didn't give it any.
There are no values in the parentheses and it wants at least one.
So, we should have said something like,
do this three times.
Let's give it an argument of three,
and now it works just fine.
So, those are some kinds of common errors that you're
likely to see as you start writing your own programs.
We'll see you next time.