# Learning Python 3 with the Linkbot/Who Goes There?
### Input and Variables

You are now ready to create a more complicated program. Type the following into your Python Editor:
Run your program to ensure that it displays the following:
Note: After running the code by pressing F5 on your keyboard, the Python Shell will only give the output:
Enter your name in the Python Shell and press enter for the remainder of the output.
Your program will look different because of the input statement. Notice that, when running the program, you must type your name and press 'Enter'. The program responds by displaying text that includes your name. This is an example of input. The program reaches a certain point, and then waits for the user to type more data for the program to include.
The user's data that the program includes is stored as a variable. In the previous program user_input is a variable. A variable is like a box that can store a piece of data. This program demonstrates the use of variables:
(Helpful blurb, Aaron, "This may not make a lot of sense right now, but refer back to it as you read the paragraph about variables.")
And here is the output:
Variables store data, such as a number, a word, a phrase, or anything you choose to make it. The variables in the above program are a, b23, first_name, b, and c. The two basic types of variables are numbers and strings. Numbers are simply a mathematical, numerical number, such as 7 or 89 or -3.14. In the above example, a, b, and even c are number variables. c is considered a number variable because the result is a number. Strings are a sequence of letters, numbers and other characters. In this example b23 and first_name are variables that store strings. Barobo, Linkbot, a + b is, first_name is, and The Linkbot was created by are the strings in this program. The characters are surrounded by " or '. The other types of symbols used in the program are variables representing numbers. Remember that variables are used to store a value, they do not use punctuation marks (" and '). If you want to use an actual value, you must use those punctuation marks. See the next example.
Both lines of code look the same at first glance, but they are different. In the first one, Python checks if the value stored in the variable value1 is the same as the value stored in the variable Pim. In the second one, Python checks if the string (the actual letters P,i, and m) are the same as in value2 (More explanation about strings and about the == come later).

### Assignment

In review, there are boxes called variables, and data goes into those boxes. Recall the previous examples. The computer sees a line such as first_name = "Linkbot", and it reads it as "put the string Linkbot into the box, or variable, first_name". Then the computer sees the statement c = a + b, and it reads it as "put the sum of a + b or 123.4 + 432 which equals 555.4 into c". The right hand side of the statement a + b is evaluated, meaning that the two terms are equal, and the result is stored in the variable on the left hand side c. In other words, one side of the statement is assigned to the other side. This process is called assignment.
One single equal sign in coding makes the line of code a grammatical statement. For example, apple = banana reads "apple is banana." By writing the code in this way, apple is assigned to banana, and they are now considered equal by the program.You are basically telling the program that the two terms are equal, even if that is not in actuality the case.
Two equal signs together makes the line of code into a question that the computer will answer. For example, apple == banana reads "is apple equal to banana?" This answer would be "no," of course, unless you have previously and incorrectly assigned apple to banana.
(Helpful blurb, Aaron, "Be careful how many = you use because it can change your program entirely!")
Here is another example of variable usage:
Here is the output:
Even if the same variable appears on both sides of the equals sign (e.g., spam = spam), the computer still reads it as, "First find out the data to store, and then find out where the data goes."
Try another program:
The output should be:
Notice that number was created with float(input) while text was created with input. input returns a string while the function float returns a number from a string. int returns an integer, that is a number with no decimal point. When you want the user to type in a decimal use float(input), if you want the user to type in an integer use int(input), but if you want the user to type in a string use input.
The second half of the program uses the type function which identifies a variable's type. Numbers are of type int or float, which are short for integer and floating point (mostly used for decimal numbers), respectively. Text strings are of type str, short for string. Integers and floats can be worked on by mathematical functions, strings cannot. Notice how when python multiplies a number by an integer the expected thing happens. However when a string is multiplied by an integer the result is that multiple copies of the string are produced (i.e., text * 2 = HelloHello).
Operations with strings do different things than operations with numbers. As well, some operations only work with numbers (both integers and floating point numbers) and will give an error if a string is used. Here are some interactive mode examples to show that some more.
Here is the list of some string operations:
| Operation | Symbol | Example |
| Repetition | * | "i" * 5 == "iiiii" |
| Concatenation | + | "Hello, " + "World!" == "Hello, World!" |

### Moving a Linkbot's Motor

Each Linkbot has two joints that it can move to do a variety of tasks. Sometimes, there might be wheels attached to the joints so that the Linkbot can drive around like a two-wheeled car. Or, the joints might be attached to a gripper, which would allow a Linkbot to pick up objects.
Each joint on a Linkbot has a number printed into the plastic. Looking at the Linkbot directly from a "top down" view, joint 1 is on the left side, joint 2 faces you, and joint 3 is on the right hand side. The Linkbot-L only has joints 1 and 2 and the Linkbot-I only has joints 1 and 3. Lets learn how to move a joint on a Linkbot!
moveMotor.py
When you run this example, you should notice joint 1 move. If you typed "90" for the input, you should see the joint rotate counter-clockwise 90 degrees. If you typed "-90", you should see the joint move 90 degrees in the clockwise direction. When you run this program, be careful about entering very large numbers or else you might have to wait a while for the joint to stop moving.

### Examples

Rate_times.py
Sample runs:
Area.py
Sample runs:
Temperature.py
Sample runs:

### Exercises

Write a program that gets 2 string variables and 2 number variables from the user, concatenates (joins them together with no spaces) and displays the strings, then multiplies the two numbers on a new line.
Write a program that gets 2 string variables and 2 number variables from the user, concatenates (joins them together with no spaces) and displays the strings, then multiplies the two numbers on a new line.
Write a program that gets 2 number variables from the user; each one an angle in degrees. After the program gets the two numbers, it makes the Linkbot rotate joint 1 by the amount in the first number, and then joint 3 (or 2, if you have a Linkbot-L) by the second number.