Hi guys. Welcome to our Module 2 variables. Previously, we learned what programming languages are and we learned the advantage of using Python. We also learned how to use print() which is output function, and input() which is the input function to build interactive program for simple input and output. It is not that hard. However, it is not that smart because we can only write something in the statement and it just execute it, and it cannot do very sophisticated or the rest of the things. The reason is we do not have variables. We are going to learn what variables are, how to define them, and how to use them. The variables. You can imagine a variable is a reference to a data or a value. This reference sometimes is quite useful. For example, if you are going to compute the data, you don't have to always remember the value of the data because a lot of time you don't know the value at this moment when you wrote your program. The value will be some result of other program, the value will be some input from the user. When you prepare the program, the value is still unknown. When you write your program, you can use something called variable or reference so that you can use the variable instead to do the computation. For example, when you talk with your friend about Capitol Hill in your conversation, people will understand you are referring to a specific building in Washington DC which is just several characters. You don't have to draw the graph, you don't to have to provide the geographic location x and y, you don't have to provide a Google Map for your friend to know what you are talking about. As long as you have the Capitol Hill as the label, people will understand you are talking about the building. When you use a variable maybe x in your computation, then Python will always use the value that x is referring to for the computation. It will make our program much more convenient. The name of the variable or the identifiers of the variable is something consists of letters capitalized A-Z, lowercase a-z, and digits 0-9, and underscore. Those are the permitted characters for identifiers, and we cannot have special letters such as the comma or question mark in identifier. Just use the combination of letters, digits, and underscore. Also, identifiers must begin with a letter or the underscore. In other words, we cannot have identifiers starting with digits. Identifiers may not begin with a digit and must begin with a letter or underscore. Identifiers cannot have special characters and also it is case-sensitive. Lowercase and uppercase will make a difference. Also, there is another restriction that is the reserved keywords such as the prints, inputs cannot be used for identifiers, or if, or else, or and, or etc cannot be used as keywords. Naming conventions. Basically we have set up a very hard rule. That is, in syntax level, we cannot use special marks, we cannot deal with digits. However, that is the minimum requirement. Actually, in our real life for the naming convention, we will use some more restrictive rules, even though it is not just for the syntax purpose because writing a program is not just for you or for a current you. Writing a program might be for a future you or for your colleagues. If you follow the naming convention for variables for functions, you will find it will be much easier for a later stage of you to understand your own program and for your colleagues to understand your program, because many times we have to read others program for debugging, for peer review, and etc, so following the naming convention is to be friendly to the community. For example, in our class, following the naming convention, we are going to name a variable always with lowercase letter. There are some special cases we are going to name a variable with all uppercases or some other combination. However, for here, we use all lowercase letter. If you are going to use multiple words as a combination for the variable's name, you can link them use underscore. Basically the name should be meaningful. If you are going to name some variable representing or referring to a value of age, then just use age and don't use A, B, C, or don't use arbitrary name so that people or you will not be able to understand. My recommendation for linking multiple words is using underscore so people will have a very good time to read your name rather than have to differentiate and have to separate them for a better understanding. Some other people prefer to use uncapitalized letter for second to the last word if we have multiple words combination. It is also widely seen in the industry, so it's all up to you, so just to make some differentiation. Important thing is don't use the capitalized letter for the first letter because that will have some special meaning. When we learn object-oriented programming, we are going to learn that if you capitalize first letter, you'll be indicating you're going to use something else rather than a very straightforward variable. We're going to talk about that later on. The simple rule is use all lowercases, and then link multiple words if they are composition of a name, link them use underscores.