anonymous
  • anonymous
PS6#3.I am just blanking,forgetting everything and with dictionary trouble.Help with 'get_words_to_points(word_list),please. http://codepad.org/bFrPW3dS There is some semblance of a start.Just cannot remember the syntax rules of everything and when certain attributes and lines are necessary(yes,the most basic bits).Yes,I read but it doesn't make sense as a whole.I might go back and grab here and there but that is not great.Sorry to be such a dope.Also,is this all there is to update? http://codepad.org/SJSm2WI8 Thank you
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
def get_words_to_points(): get_points_dict = {} print 'Loading point values of words ...' ## cycles through the wordlist creating a dictionary ## with the word as the key and the point value as the entry for index in range(len(word_list)): get_points_dict[word_list[index]] = get_word_score(word_list[index],HAND_SIZE) return get_points_dict I think this works
anonymous
  • anonymous
Hey,thanks for the response.Looks OK(just changed my own notation)but I am not in position to question another. That is sort of the method from earlier, have you tried using any of the shortcut tools for dictionaries? Wondering if those could be useful/better or even applicable. Also,did you check out my second link for the update using the dictionary? Seems stupid and wrong but maybe.
anonymous
  • anonymous
what are the dictionary shortcut tools? you could do it when you first load the words: http://dpaste.com/695441/ why do you think your updated is_valid_word function is wrong? does it work? here is mine: http://dpaste.com/695442/

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Don't know if updated is_valid_word works.Honestly,one big issue is I just lose track of variables and what is temp and what is Python language.Just overwhelmed to try to just test this piece and figured someone could tell with a look. So when you are looking for strings in a dictionary, you can just name the dictionary, no need to name keys or values?I see in yours you just have 'word' and points_dict and I had points_dict(keys) thinking it was only looking through those and trying to be careful.
anonymous
  • anonymous
i think keys is the default if not specified - don't know where i read that, probably somewhere in the docs didn't you test it before you posted it? tsk, tsk looks like it might work to me. here is a test i wrote for mine: http://dpaste.com/695491/
anonymous
  • anonymous
Here are some pieces of code for parts of the problem.Any scoldings on all the things I left out or are needed in there are welcome.I am not sure of the syntax and use in certain cases(and I looked around),especially line 29 and 25,trying to pick out the key and add it to the list and then sort it pick out last(highest value/score).But I have confused how to use the functions.I changed my approach to the problem after being sort of through it.Here is the link. http://codepad.org/7O7c9Toh
anonymous
  • anonymous
lines 23-31 will find the highest score but doesn't preserve the word itself. I think you need to use itertools permutations with points_dict - consider the hand 'dbac' it.combinations won't produce the word bad but permutations will http://dpaste.com/696045/

Looking for something else?

Not the answer you are looking for? Search for more explanations.