 The programs you write in this course have three major phases. The first phase is the input phase where you ask the user for input from the keyboard or you read data from a file. The next phase is processing where you manipulate the data, you do some sort of calculations, and then once you have the results you have the output phase which is where you display results on a screen or you write the results to a file of some sort. When I write programs I usually like to keep these phases separate so I do my input first, then my processing, then my output. I tend not to interleave them, do some input a little bit of processing then some output, then more input processing and output because that tends to be a bit confusing. In the processing phase there are three major types of things you can do. The first one is sequence, doing things one after another. That's what you did with the robot example. You did one step, then another, then another, then another, one from the beginning to end until you were finished. Another type of thing that you do during processing is repetition. For example, with the robot you could say keep taking a step forward until you get to the door. So it would do the same step over and over and over again until some condition were satisfied and that leads to the third kind of structure that you will find during processing, which is called conditional. So you could say to the robot, if you have an object that is... if you have picked up an object, then put it down. Otherwise, turn counterclockwise. So your processing phase consists of sequence, repetition and conditional structures and that is the stuff that does the heart of the program and that's surrounded by the input to get your data and the output to display the results. There are three types of errors that you can make in Python. The first type is called a syntax error. By the way, this number sign that I'm typing in the shell is a comment. That means Python should ignore it. It's just there for us humans to read. A syntax error happens when you say some of this grammatically incorrect in Python. So for example, if I try to say 34 plus times 8, that doesn't make any sense mathematically. It's just wrong on every possible level. So when I press the Enter key, the shell will respond, showing me that the star is where it got confused and says that's invalid syntax. You can have another kind of error called a runtime error. This happens when you do something that is syntactically valid. It's grammatically valid. For example, if I try to evaluate 42 divided by 0. Well, syntactically in terms of grammar, I have two numbers and a division sign between them. But when it comes time to actually run that calculation, I get an error that says zero division error because you can't divide by zero. These two types of errors are usually pretty easy to find. Syntax error is the easiest because the compiler points them right out to you. And runtime errors because once you run the program, you see the error front and center. The third type of error is called the semantic error, which means you said something that's syntactically correct grammatically, and it's not going to cause any errors when you run the program, but it doesn't do what you wanted it to. So for example, if I wanted to find out how many days there are approximately in 25 years, and I accidentally typed 25 plus 365, there's nothing wrong with that in terms of mathematics. I have two numbers with the plus sign. There's no runtime error because I can certainly add 25 and 365, but the number I get is nowhere near the correct answer because I've said something that is a semantic error. I didn't do the computation I intended to do. Semantic errors in general are the hardest ones to find because the compiler can't help you. The runtime system can't help you. It's only when you as a human look at the error at the result and say, wow, this is not what I intended.