Friday, January 21, 2011

Jan 21

OK well today I'm continuing on my exercises trying to catch back up to chapter 5. Um I'm starting out on chapter 2.  
#5:
float
str
'The knights who say "ni!"'
invalid syntax
'The knights who say "ni!"'
#6: bruce = 6
bruce + 4 = 10
#7: had to write a python program.
Chapter 3
#1: (I had a lot of difficulty with this question due to the fact that i instead had def new_lines(): instead of def new_line():. talk about one thing messing your program up).
def new_line():
    print
  
def three_lines():
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()

three_lines()

def clear_screen():
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
  
clear_screen()
#2: When I move clear_screen() to the top of the program I get: Invalid syntax error.
#3: With me moving new_line() around the program, I got errors saying that new_line() is not defined and Invalid syntax.
Um ill continue this next week, I've learned from the program on #1, is that 1 error can cause everything to mess up no matter how small the error is.

2 comments:

  1. Indeed, computer programs are completely unforgiving of syntax errors. I always like to remind students that computers are "dumb as rocks". They are machines, so they can't feel their way to what the programmer means. It needs to be correct or else it simply doesn't compute!

    ReplyDelete
  2. On Monday take some time to describe what goals you are setting for yourself for 3rd quarter (see http://ict.gctaa.net/at/assgn/3rdqplan.html). That gives both you and me a way to evaluate your progress as the quarter proceeds.

    ReplyDelete