Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 15 Online
OpenStudy (anonymous):

Ps9: working with iterators I'm not sure I'm working with iterators correctly and I didn't find the python documentation referred to in the problem set very helpful. In particular, I'm not sure I've defined __str__ in ShapeSet very efficiently (see ln 135-145). Any comments on my other code is also welcomed! http://codepad.org/IKKx062f

OpenStudy (anonymous):

Did you test __str__ in ShapeSet? Yours is the shortest I have seen. Maybe line 145 is missing something if you have a problem. I did not look through the rest of it, only that. And if you just want a straight answer, sorry. I can do that. Though it seems the board attempts to merely guide to that place.I think that sometimes, you just need the answer. Also, I am not exactly the foremost expert here but hope I am not wrong and am contributing since I was on the asking end so often.

OpenStudy (anonymous):

i tested your shapeset with this: http://dpaste.com/703145/ and it seems to work fine nice list comprehension at 158 would this work for 159-162? maxList = [n for n in shape if n.area() == maxArea] here is my ShapeSet, same thing but different - i used a dictionary instead of a list http://dpaste.com/703155/

OpenStudy (anonymous):

hi Six, I was working on this problem as well and I have very similar code. For the __str__ in ShapeSet, I think you missed the '.members' so for n in self: should be changed to for n in self.members: Pretty sure you figured it out already, but I was going through Open study to check my answers and came across this post

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!