winterthunder: (Default)
Amazing Little Ecosystem ([personal profile] winterthunder) wrote in [community profile] intro_to_cs2010-02-07 09:28 pm

Lecture 6

So, who thinks the other professor was better? I'm finding this guy harder to follow, though I did catch that computers can be wrong and paranoia is good.

Paranoia, paranoia everybody's coming to get me...

Er.





I have to say, I understand the whole lists, appending lists, concatenating lists idea, but I'm not following the code. For the universities bit, what are all the raw_inputs there for? Is the for loop just there to show that appending lists is messy? And which line is the concatenate? Is it "Univs = Techs + Ivys"?

(Class handout is here, and I've pasted the relevant code section under the cut.)


Techs = ['MIT', 'Cal Tech']
print Techs
Ivys = ['Harvard', 'Yale', 'Brown']
print Ivys
Univs = []
Univs.append(Techs)
print Univs
Univs.append(Ivys)
raw_input()
print Univs
raw_input()
for e in Univs:
> print e
> for c in e: print c
raw_input()
Univs = Techs + Ivys
print Univs
raw_input()
Ivys.remove('Harvard')
print Univs
Ivys[1] = -1
print Ivys

[personal profile] aranthe 2010-02-15 03:45 pm (UTC)(link)
I finally watched 6 and 7 yesterday and discovered that I probably need to update my solution to the last problem in PS4 to use NR instead of bisection. Which is kind of annoying, but not nearly as annoying as his remark about both being a possible problem under certain conditions but we're going to drop it for now...

JcUolZKXcrKozMsPoyL

(Anonymous) 2012-01-07 09:58 am (UTC)(link)
I don't even know what to say, this made things so much easeir!