winterthunder: (Default)
Amazing Little Ecosystem ([personal profile] winterthunder) wrote in [community profile] intro_to_cs2010-01-10 04:43 pm

Lecture 2

All right! Hopefully we've all successfully completed Problem Set 0 and are ready to tackle Lecture 2. Note that there is a handout associated with this lecture, and having it printed out before starting is a really helpful thing. Not that I had to stop and print it in the middle of lecture or anything...

Also, since our problem set numbers started with 0, I'm going to put up a post for PS1 this Friday. From that point on, problem sets will go up every other week.







I had one problem with this lecture, and I'm hoping you all can facilitate a light bulb moment. The code example with x, y and z, the fourth one down the page... I can't figure out what the bug was. Is it just because the statements aren't indented, or is there something else?
zulu: Hugh Laurie as House, with text: seeker after truth (house - truth seeker)

[personal profile] zulu 2010-01-10 10:05 pm (UTC)(link)
I'm not sure where the handout is, so this is just a guess, but maybe the bug is that there's no colon after the first instruction? For instance, this is correnct:

if x > y:
     print x

But this is not correct:

if x > y
     print x
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2010-01-17 02:37 pm (UTC)(link)
Oh goodness, thanks for that. I've been having a hard time making out some of the code examples; forgot it was in the handouts. This should make things easier :)