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

ok, Im seriously stuck on ps8#4. here's what I've come up with: http://dpaste.com/hold/567301/ I know that it isn't giving me the names of the courses yet, but I'm saving that for later, since first I'll need to get the math correct.

OpenStudy (anonymous):

I need anyone to show me their answer (duh I can use google that), I need help with the logic so I can figure it our for myself.

OpenStudy (anonymous):

well whats going wrong? you have a set of code down so your not stuck in ideas.

OpenStudy (anonymous):

I'm not getting the correct output and I'm not sure if I have the concepts down correctly...

OpenStudy (anonymous):

no math in this one ... all process if i see it correctly, in lines 186 and 189 you return/preserve a subject's work value in line 196 you preserve a subject's 'learn' value (plus whatever comes back from the recursion) this seems inconsistent also if you don't save/preserve something unique like the subject name or the index, you won't be able to reconstruct the dictionary later

OpenStudy (anonymous):

Thanks for catching that. I changed the lines 186 and 185 to reflect the coursaVal, not courseWork. I'll have to think a little bit further for the storing indices or something....

OpenStudy (anonymous):

you can store the indices if your using a list not a dictionary, x = dictionary.keys() is a good list to use in conjunction with a dictionary

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!