6.01 Lecture Notes - Lecture 11: Briey, Init, Stack Machine

6 views11 pages

Document Summary

111 def take(self, amt): self. yours = self. yours - amt return self. yours def howmuch(self): return (b. yours, a. yours, self. yours) Write none when there is no value; write error when an error results and explain brie y why it is an error. So, rst, the amount is used to increment b. yours to have value 6. Then, we return a. yours and test. yours, which are both unchanged: (6, 0, 3): this just returns the current values of all three yours attributes, one in each class de nition as well as test. yours. 3. 8. 6 practice problem: the best and the brightest. # code will go here def funofbest(self, fun, feature): For the rst two problems below, assume that these methods have been implemented. "chris": write a python expression that will compute the name of the person who has the greatest value of iq + height in aardvarku (not just for the example student body above).