Recent Changes

Saturday, August 7

Tuesday, July 20

  1. msg List comprehension message posted List comprehension I added the section on list comprehension and the exercise to illustrate (#3). Let me know if ther…
    List comprehension
    I added the section on list comprehension and the exercise to illustrate (#3). Let me know if there are problems with it...

    Matt
    4:00 pm
  2. msg Mutating lists in loops nitpicking message posted Mutating lists in loops nitpicking I agree with Peter. I've got an example in the second week where I show the pitfall of modifying t…
    Mutating lists in loops nitpicking
    I agree with Peter. I've got an example in the second week where I show the pitfall of modifying the list from the loop, but we should be technically clean about this in the beginning.
    3:37 pm

Thursday, July 15

  1. msg Mutating lists in loops nitpicking message posted Mutating lists in loops nitpicking Hey Terry, While I absolutely agree that pass-by-value/pass-by-reference type semantics are subtle…
    Mutating lists in loops nitpicking
    Hey Terry,
    While I absolutely agree that pass-by-value/pass-by-reference type semantics are subtle and way outside the scope of this course, the statement that "we are saving (and doing stuff to) a COPY of the item in the list" isn't quite true. See, for example:

    li2 = [[1],[22],[48],[36],[101]]
    print li2
    for l in li2:
    l.append(23)
    print li2

    Maybe rephrasing to something like: "When we are looping over the list, the value of each of the items are sequentially put into the loop variable" would be both true and informative.

    -Peter
    12:28 pm

More