In Class: Week 2 Tuesday, Thursday


Run update21 to download this week's files, then move to the week02 directory

    % cd 
    % cd cs21/class
    % pwd
      /home/your_user_name/cs21/class
    % cd week02
    % pwd
      /home/your_user_name/cs21/class/week02
    % ls
	

Topics


We are going to do some of the following:

  1. open expr.py in vim. This program contains some examples of numeric expressions and order of evalution. Let's take a look at some of them.

  2. Together we are going to write a program that computes the average of integer values that are entered by a user by employing the accumulator pattern. Be careful to avoid errors due to integer division.

  3. open test_math.py in vim. Work on using the math library and accumulator pattern to solve the problems.

  4. After introducing strings, we will take a look at test_string.py. Review the first few lines of code, and together we will solve some of the easier problems. Then, practice using indexing and slicing to print out the months of the year.