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?
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!!!
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
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
oh... well in that case this is probably a lot more difficult!!
if you've not done problem set 6, then this will probably make no sense...
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.
actually i just got it to work, but thanks anyway!!
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
yeah, its awesome!
Join our real-time social learning platform and learn together with your friends!