 A reserved word is an identifier that is specially reserved by the language. That is, you're not allowed to use that word for your own identifiers. Pigeon has only a couple dozen reserved words. You've seen a few of them already. The operators add, sub, mole. There's also div for the division operation, and shortly we'll introduce a few more. When we give a variable a value, that's called an assignment. To perform an assignment in Pigeon, we write the reserved word as, followed by the name of the variable, and then the value to assign to that variable. So here, for example, in the top line, we are assigning the value true to a variable named dog. And in the next line, we're assigning the value negative 87.2 to a variable named newt, and then the value null to a variable named bird, and lastly a string with a text, rubber baby buggy bumper, we're assigning that to a variable named cat. So now, let's look at our first actual sequence of code. As bar 19 assigns the number value 19 to a variable named bar, and then in the next line, as foo bar assigns the current value of bar to a variable named foo. So foo also now has the value 19. And then in the next line, as bar three assigns the value three to the variable bar, and in the final line, the value returned by the add operation is assigned to fizz. This add operation returns the sum of 11 in the current value foo. So what is the current value foo? Well, it's whatever we last assigned to it. And foo was last assigned to 19. So we sum 11 and 19 returning 30, which is then assigned to fizz. So that's the key concept here. When we use a variable, it has the value of whatever was last assigned to it. This can be a confusing point if you learn programming starting with some other languages because in most popular languages, assignment is denoted with an equal sign. So instead of writing as foo bar, you would write foo equal sign bar. And this gives many students the false impression that what assignment does is somehow create an equation. That assignment creates a persisting relationship between the two variables rather than just give the target of the assignment the current value of the other variable. And so here in this case, that misconception would lead you to believe that when we assign three to bar, that we are also affecting foo and giving it the value three as well. But that's not how assignment works. When we assign to bar, it's just assigning to that variable, not any others. foo still retains the value 19 because that's the last value which we assigned to it. In fact, that's how assignment works in all languages, even in languages that misleadingly use an equal sign to denote assignment. Like in mathematics, we use the term expression to refer to anything which evaluates into a value. So an expression and code may be a literal, like null, or the string here, hello, or it may be a variable because a variable evaluates into whatever value was last assigned to it. Or an expression may be an operation because operations return values, like say the add operation here will return the sum of foo and foo. Note that an operation is a kind of expression which itself contains other expressions. So in the add operation here, the variable foo, that itself is an expression, and the number little foo, that itself is an expression. These expressions made up of other expressions we sometimes call complex expressions in contrast to simple expressions. Another important jargon term is statement. Statement is just a generic term for the units of syntax that make up our code, somewhat analogous to sentences in English. Our code is a series of statements. So far, we've seen two kinds of statements, assignment statements, and expression statements. An assignment statement, as we've seen, begins with the as-preserved word, and an expression statement consists of just an expression, usually an operation to perform some action. So here, for example, as foo 53, that's an assignment statement, and then the next line, the addition operation is an expression statement. Now it'd be clear that this is an unrealistic example of an expression statement because an addition operation by itself doesn't do anything useful. It just produces a new number value which doesn't get used, so this statement here is effectively pointless. Let's introduce two operators for which it actually makes sense to invoke them as standalone expression statements. The first of these operators is print. A print operation takes one operand and displays its value as text in a console window. If you're not familiar with the concept, consoles, also called terminals, are the simplest possible way for programs in modern operating systems to display text output and get keyboard input from the user. We'll discuss consoles in detail in a later unit. In any case, here in this code, the first line print with the string waka waka will display waka waka on the console. The second line assigns the value 19 to a variable bar, and then in the last line, we print the value of bar, which at this moment is 19, so the value 19 is displayed on the console. The prompt operator gets keyboard input, which the user types of the console. When prompt is invoked, the program waits while the user types of the console, and then when the user hits enter, they've typed as returned as a string by the prompt operation. So here in the first line, we invoke prompt, the user types of the console hits enter, the prompt operation returns that text as a string, and that string is assigned to the variable foo. Then in the next line, if we print foo, that same string is displayed on the console. Effectively, whatever the user types is repeated back to them. For the sake of simplicity, print and prompt are going to be the only means we have in Pigeon to perform input and output. We have no other way to put something on screen or get input from the user. This is not because of anything fundamentally limited about Pigeon, where Pigeon developed into an actual language that would be perfectly capable of doing any input and output, but for educational purposes, we're keeping things simple. Ultimately, doing anything interesting in code, of course, relies upon things like storing data in files, drawing on the screen, getting mouse input, and so forth, but you should accept now that in this course, we'll be going through hours of material before we do any of those things. The approach is both easier and in the long run more efficient, and will give you a better understanding of how programming actually works than a flashier approach would. Starting with graphics programming, for example, just makes things more confusing, because that approach inevitably requires glossing over fundamental concepts. You'll get the thrill of seeing your code do something flashy, but you won't really understand how you did it. Now that we have the print operator, we can write our first program, which is the traditional first program students always write, called Hello World, on the screen, the text Hello World. In Pigeon, this program is exceedingly simple. It consists of just one statement, a print operation with a string Hello World. In some other languages, though, Hello World can actually be surprisingly complicated.