anonymous
  • anonymous
ps6 p4 - so i'm trying to figure out the most efficient way of sorting a string by the values of the characters in the string according to the scrabble value dictionary. At the moment I'm thinking I should create a dictionary of the word, then use import operator and itemgetter to create a sorted list of tuples as a representation, and then slice that list of tuples up to extract the sorted word. But this seems to me an enormously laborious process... and besides I haven't seen itemgetter in the lectures yet... so there must be a more efficient way to do this surely?
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
just because you haven't seen it in a lecture doesn't mean you cannot use it this is not a Python class I am not sure i understand - you want to rearrange the letters in a string so that they are ordered according to their scrabble point values? have you read this? http://docs.python.org/howto/sorting.html http://docs.python.org/library/functions.html#sorted use the sorted function with a custom comparison function
anonymous
  • anonymous
spoiler - http://codepad.org/JVabgH3m

Looking for something else?

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