“what is a list of tuples, and why is the data structured this way?”) But first, it’s useful to do a compare-and-contrast between Base R and Python Builtins. This post will help you make sense of this output (i.e. The list is ordered so that the highest-scoring word appears first: > get_all_words('ilzsiwl') It returns a list of tuples that represent valid words you can form from those letters, along with their score in Scrabble. The key function is get_all_words, which takes a string that represents a set of tiles. You can view the “Scrabble Cheat” project on github here. Additionally, most data-related jobs in Industry (as opposed to Academia) use Python rather than R. However, over time I’ve learned that many of my readers are also interested in Python. Most people read my blog because of Choroplethr (my suite of R packages for mapping open datasets) or my various R trainings. I just wrapped up this project and decided to share it because it might help others who are interested in Python. Voila – my first Python side project was born! Eventually I realized that it would be straightfrorward to write a program in Python that looked at my rack of letters and listed the highest scoring word I could create. The problem is that I hate the game, and not good at it, and kept on losing. In order to pass the time my mother (a retired English teacher) became obsessed with Scrabble and insisted on playing game after game with me. This all changed during the COVID-19 lockdowns. While I was interested in having a side project in Python for a while, it took me a while to find a project that interested me. Side projects are great for learning a language because they let you “own” a project from start to finish as well as solve a problem that is of genuine interest to you. After taking a few online courses, I became comfortable enough with the language to tackle a small side project. My New Year’s Resolution was to learn Python.
0 Comments
Leave a Reply. |