Starting today every Monday we release a code challenge here on our blog. On Friday we publish one or more solutions.
The goal is to have us and our readers work on the solution during the week.
To keep it simple we don't accept pull-requests at this time. Just fork our repo and work on your solution locally.
To have the tests pass import the right module, do this when you have a local clone of the fork:
$ cd <challenge_number> (this week = 01) $ cp name-template name.py # code ...
If you want to share your solution just share your commit link in the comments of our Friday review post. (Monday post = questions / Friday post = solutions + reflection).
Check this link how to keep your fork in sync with our repo.
Remember, we don't strive for the 'best' solution, it's not a competition. We do of course strive to have good Pythonic solutions so any feedback is welcome, but do respect the newby / learner. Again, learning more + better Python is the main objective.
Finally we believe fixing code challenges is a very effective way to become a better programmer.
This week you will write a script to calculate the (language) dictionary word that would have the most value in Scrabble.
Read in dictionary.txt (a copy of /usr/share/dict/words on my Mac) and calculate the word that has the most value in Scrabble based on LETTER_SCORES which is imported in wordvalue-template.py.
See the full code challenge here.
This will be a two-part code challenge. Next week you will expand on this building a simple command line game. Something like giving a user a bunch of letters and let him/her create a high-value word (like Scrabble but without the board).
Fork our repo and get coding ... have fun!
Any feedback or comments are welcome below or on HN. Thanks for trying!
Keep Calm and Code in Python!
Bob + Julian
Do you want to get 250+ concise and applicable Python tips in an ebook that will cost you less than 10 bucks (future updates included), check it out here.
"The discussions are succinct yet thorough enough to give you a solid grasp of the particular problem. I just wish I would have had this book when I started learning Python." - Daniel H
"Bob and Julian are the masters at aggregating these small snippets of code that can really make certain aspects of coding easier." - Jesse B
"This is now my favourite first Python go-to reference." - Anthony L
"Do you ever go on one of those cooking websites for a recipe and have to scroll for what feels like an eternity to get to the ingredients and the 4 steps the recipe actually takes? This is the opposite of that." - Sergio S