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

Problem Set 6, problem 3: my get_words_to_points just keeps running and running. It takes 5 minutes to return the points_dict dictionary, but then continues running! help?

OpenStudy (goodbye):

people are gonna tell u to post your code, somewhere like dpaste.com If you want i can post my code for that function.. I have made it my mission to help u get this function working. POST YOUR CODE, lemme have a look!!!

OpenStudy (anonymous):

def get_words_to_points(word_list): """ Return a dict that maps every word in word_list to its point value. """ points_dict= {} for word in word_list: score = 0 for letter in word: score += SCRABBLE_LETTER_VALUES[letter.lower()] points_dict.update({word:score}) return points_dict It shouldn't be that hard really, I am basically using values from what they've given us like the scrabble letter values and the word list. It isn't like this is a function building off of another possibly erroneous function. It would be great if you could run it and see if it works

OpenStudy (goodbye):

this isht is messed up, that reply was supposed to go in the barnyard question.... anyway i'll see if i can help, gimme a min to look at your code

OpenStudy (anonymous):

oh... well in that case this is probably a lot more difficult!!

OpenStudy (anonymous):

if you've not done problem set 6, then this will probably make no sense...

OpenStudy (goodbye):

i have done problem 6, i just finished problem 8, (after like 2 months, and i ended up kinda plagarising the answer , but oh well) And my replies did go the right place, but damn, this site can get laggy. http://pastebin.com/7Rha2G5y ^that's my code, in case u wanna look at it. in the mean time im gonna try figure out why your code isnt working, you'll proabbly solve it before me. the first thin i noticed though is that you declare points_dict in the get_words_to_points() function. but i have it at the top as a global variable kind of thing, i dont know if that is relevant. anyway im gonna keep looking at your code and try to figure it out.

OpenStudy (anonymous):

actually i just got it to work, but thanks anyway!!

OpenStudy (goodbye):

awwwwwwwwwwwwwww crap, i wanted to be the one to sort it out.... :( well done tho, dont u just love it when u solve the problem , hehe

OpenStudy (anonymous):

yeah, its awesome!

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!