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

I'm doing PS8 problem 2 (Greedy Advisor) on the 2008 course. I am getting an index error and I can't figure out why. Can anyone give me any ideas? Here is my code http://dpaste.com/797305/

OpenStudy (anonymous):

Could I get the line number of the error. also this is what I came up with when I did it. http://dpaste.com/798203/

OpenStudy (anonymous):

Well I'm actually not getting an error message now. The problem is that it just runs forever. I think there is a problem with the while loop. It's just on the greedyAdvisor function from line 100. Here is the code with newly added comments: http://dpaste.com/798926/

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!