Chase Thompson
4 min readMar 7, 2020
Scrabble letters saying ‘Shift Happens’
photo credit SOULSANA

As someone new to tech community, it can be daunting to start a new project. There is an enormous community behind almost every app, tech stack, methodology, etc. What if my solution isn’t robust enough? Was that the best method to use in that instance? Are my variables names stupid?

All that pressure can then be compounded by the process of presenting your work to world via an article, talk, video, etc. Code isn’t the only place syntax matters.

All of that is to say, here’s my inaugural contribution to the tech world. Please, hold your applause until the end.

Recognizing Opportunities

I’ll be graduating as a data scientist this summer. I’ll write more about the data science program I’m enrolled in eventually. The timing will depend widely from person to person, but there comes a point, regardless of the discipline, when you start to recognize opportunities for you to apply your knowledge.

As a architect you see the usage of space, structures, materials, and a plenty of other things very differently than when you started your journey.

Technology, and all of its disciplines, are no stranger to this phenomenon.

Before a recent lecture started, one of the instructors brought this topic up. He asked if anyone listened to NPR on the weekends. There is a fantastic quiz show called Wait Wait… Don’t Tell Me! that airs on the weekends. If you’ve not caught an episode before, I’d highly recommend it.

He presented us with a warm up exercises based on a puzzle from a few years ago.

The Challenge

Apparently, while gallivanting about on a weekend in 2016 he caught the tail end of an episode. During this segment they reviewed the previous week’s challange, and then presented a challenge for the following weekend.

Take the word EASY: Its first three letters — E, A and S — are the fifth, first, and nineteenth letters, respectively, in the alphabet. If you add 5 + 1 + 19, you get 25, which is the value of the alphabetical position of Y, the last letter of EASY.

Can you think of a common five-letter word that works in the opposite way — in which the value of the alphabetical positions of its last four letters add up to the value of the alphabetical position of its first letter?

Link to the original audio

He immediately recognized the inherent opportunity to solve this puzzle using Python.

Starting A Project

The process for tackling any project, challenge, or task will vary from person to person. Some will start with a text based breakdown of where they’d like to go, others will jump right into the code.

For the majority of data science projects, I feel like its best to begin with a focus on the science side of things, rather than data — that is to say the tech side.

For this project, however, there wasn’t really a need to develop a hypothesis, plan for the data gathering, etc.

This was a fairly straight foward task. Though, it was still helpful prior to jumping into VSCode or spinning up a Jupyter Notebook, to lay out map of what was needed to accomplish the goal.

Planning process:

# a five letter word where the alphabetical value of the last 4 characters == the alphabetical value of the first character

# a few things to consider regarding this:
# how do we find the alphabetical value of a letter?
# we only need 5 letter words
# to be a “match” alpha_value(word[0]) = sum(the rest of the letters)

# The Plan
# filter the list down to only 5 letter words
# define a function to find the alphabetical value of a character
# create a function to see if a word is a “match”
# loop through all the words and use the function defined above

This is the framework I used to solve this challenge.

Much like the original challenge, I’ll leave you with the challenge for a few days. I’d love to see what solutions you come up with.

In case you need a place to start, here are a few options for finding your list of words. If you’re on a Mac you can find a list of words at /usr/shar/dict/words.

If you’d like a different list, or if you’re on a different operating system, you can us the nltk library for python. It contains a bunch of other functions and useful data, but we’ll key in on the list of all english words.

You can access like this:

from nltk.corpus import words
words = words.words()
print(words)

There is a change you’ll have to download the word list using nltk’s download() function. Use this code to select the data you want:

import nltk
nltk.download()

Some code to get you started:

with open('/usr/share/dict/words') as f:
words = f.read().split('\n')

print(words[:5])

In the next article I’ll share my solution for this challenge. That’s a wrap for my inaugural article based contribution to the tech world. You may proceed with the applause. Really though, thanks for check out the article, see you in part two.