- 1

Dictionary=["a","am","at","apple","bat","bar","babble","can","foo","spam","spammy","zzyzva"] We also have global Scrabblescores List How get this output: >>>scoreList(["a","s","m","t","p"]) [['a',1], ['am',4], ['at',2], ['spam',8]]

5th Oct 2016, 3:05 AM
Vinh Le
Vinh Le - avatar
4 Respuestas
+ 1
your dictionary is actually a list. your program should take the scoreList letters, combine them in all ways possible and check if each of those ways is in your dictionary (the list called dictionary). for each word it makes i in that list, add it to a list of good words, then finally output a dictionary where the good words are the keys and the values are the sum of the scrabblescore for each letter in that word.
5th Oct 2016, 3:24 AM
Luke Armstrong
+ 1
scoreList(["a","s","m","t","p"]) gives you a group of letters to work with. you need to figure out how to take those letters and make a list of good words (words that exist in Dictionary). Once you have made the list of good words (once you have tried every combination of letters) then you make a dictionary that uses the words as the keys, and calculates the values by getting the sum of the points for each letter from your global list. so you have 3 parts to build. 1 - something to make all possible combinations of the given letters 2 - something to check the dictionary for each of those combinations and add it to a good_word list 3 - a dictionary made from the good_word list that calculates the values by using the global scores list.
5th Oct 2016, 3:35 AM
Luke Armstrong
+ 1
Thanks ! Let me try that way
5th Oct 2016, 3:38 AM
Vinh Le
Vinh Le - avatar
0
Can you explain more detail pleaseee
5th Oct 2016, 3:26 AM
Vinh Le
Vinh Le - avatar