TEST 1 REVIEW
CG 120
I have listed somethings you should make certain you know for the test. This list may not be complete but is a good start for your reviewing.

Be certain to look over the first three labs you have done so that you are familar with what you did on those assignments.

Here are some reasons that Python is better for secondary math majors than Pascal

VARIABLE NAMES
A variable name must start with an alphabetic character and can be followed by alphabetic characters, digits (0-9), and the underscore character. A variable name can be as long as you want, however practically I would suggest not making them longer than 10 or characters. Python distinguishes between the case of letters so that the variable name, Max, is different from the variable name max.

ASSIGNMENT OPERATOR
The assignment operator is the equal sign. It does not stand for equality but rather it says to take the value of the expression to the right of it and place that into the variable on the left of the assignment operator. This is the way variables are created in Python.

   x = 2

This says created an int variable called x and give it the value 2. Following this we might have a line:

   x = x + 3

This says to take the previous value of x and add 3 to it so that x's value will now be 5. The previous line of code can also be written as:

   x += 3

One can do multiple assignments in Python:

    x = y = 7

PRIMITIVE TYPES
There are 3 types of primitive variable types. They are:

It is possible to convert between types by giving the commands: int(), float(), str(). Of course you can't convert 'abc' to an int but you can '123'.

INPUT/OUTPUT
Input and output for Python is done using the commands:

The command raw_input() returns a string type value and it may be necessary to convert it to a numeric value if that is what is wanted. Print allows you to display output. Multiple items can be placed after the print by using commas between the various items.

OPERATORS
The operators that we have discussed so far are:

The following are some additional operators that work on boolean values (true or false): The next operators generate boolean values (true or false) MISCELLANEOUS FUNCTIONS CHAPTER 3 - numeric types
Precedence order of operations: (highest precedence first) There are several built-in functions in Python. See the table in your book on page 62. Other mathematical functions exist in the math library. These are made available by giving the command:
    from math import *

These are listed in a table on page 64 of your book. Also the random function is made available by giving the command:
    import random

CHAPTER 4 - strings:
There are escape sequences in Python which are accessed by using the \ symbol:

The following are some string functions that you should know: There are more operations given in your book, but we will stop with these. If we need others later, we will discuss them.