Outline for April 3, 2014

Reading: § 2
  1. Python, files and shells
    1. Python: programming language that you use to tell the computer what to do
    2. Shell: what you can type Python statements directly into, to see what they do
    3. IDLE: the program that interprets Python statements (executes the Python program)
    4. File: type Python statements into this, and then have IDLE execute those statements by running the program in the file
  2. First program: hello, world [hello0.py]
    1. Explain printing
    2. Demonstrate program in IDLE
  3. Variables
    1. What they are
    2. Variable names
    3. Variable types (int, float, string)
    4. Python keywords
  4. Statements
  5. Simple assignment: variable = expression
  6. Expressions
    1. Operators +, -, *, /, //, %, **
    2. Precedence
      1. Parentheses for grouping ((, ))
      2. Exponentiation (**); associates right to left
      3. Positive, negative (unary +, -)
      4. Multiplication, division, integer division, remainder (*, /, //, %)
      5. Addition, subtraction (binary +, -)
      6. In general, operators of equal precedence are evaluated from the left to the right (associativity); exception noted above
  7. Examples
    1. Temperature conversion [temp.py]
    2. Compute the hypotenuse of a right triangle [hypotnoex.py]
  8. The difference between strings and integers [twoplustwo.py]
    1. Difference between ’2 + 2’, 2 + 2
    2. Print statements usually end lines
    3. Getting print statements not to end lines

You can also obtain a PDF version of this. Version of April 4, 2014 at 9:10PM