Outline for October 1, 2012

Reading: none
Assignment Due: October 12, 2012 at 5:00PM


  1. IDLE
    1. How to use it
    2. How to start, open a new window
    3. Python shell, prompt
  2. 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
  3. Example using IDLE: hello, world
    1. Explain printing
    2. Demonstrate program in IDLE
  4. Second example: compute 2 + 2, properly labeled [twoplustwo.py]
    1. Difference between "2 + 2", 2 + 2
    2. Print statements usually end lines
    3. Getting print statements not to end lines
  5. Exceptions [divby0.py]
    1. Division by zero
    2. How you handle it
  6. Third example: chaos program, incomplete version [chaos.py]
    1. Comments
    2. Function input() gets input as a string from user
    3. Function float() converts data to a floating point number
    4. Assignment to variable; evaluate right hand side first
    5. For loop generally
      1. Built-in range() function
      2. Index variable i initialized to 0
      3. Expression using multiplication, subtraction, and variables
      4. Printing a number
    6. Behavior with initial values of 0.25 and 0.26
    7. Lack of error checking: what happens if I enter −0.01?


A PDF version is available here.
ECS 10, Basic Concepts of Computing
Fall Quarter 2012