Thursday, November 28, 2013
Week #11 - Term Test #2
I got my second test back. I did A LOT better on this time compared to the last test. Maybe because there were less questions. I talked to another classmate at the office hours and he made the same mistakes as I did. We both counted the same interior node twice and forgot to use n.value instead of n. If I used tuple unpacking for the first question, my code would've been simpler. One of the benefits of using tuple is that you don't need a temporary variable to swap values. You can just do this: b, a = a, b in Python. Tuples are immutable so they can be used as keys in a dictionary like strings. On the second question, I got one mark off for not using n.value. I should always remember that n refers to the node and if I want the value I should use n.value. I'm happy I did better on this test. I hope I do well on the final and increase my mark!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment