Today, I wanted to play around with names and numbers, specifically figuring out a way to assign a numerical value to a name. It sounded like a fun little project, so I dove right in.
Getting Started
First, I needed a way to convert letters to numbers. The simplest approach seemed to be just assigning numbers based on alphabetical order. You know, like A=1, B=2, C=3, and so on. I figured I could do this easily with a little bit of code.
The Coding Part
I opened up my trusty code editor and started to write a plan, first I needed create a simple function. My idea is Input a name, the function help me to change every letter to number. The code as my plan:

- Take a name as input.
- Make all letters into lowercase.
- Go through each letter in the name.
- For every letter, Get number. A=1,B=2…
- Add number to list.
- Sum all number, get the total number.
I test my function with some sample names, like “Mike”,”Jack”. It worked, I can see total number from names!
Thinking More
I got to thinking, what if I wanted to handle names with spaces, like “John Doe”? I mean, should I count the space? I decided, at least for now, to just ignore spaces. So, I made a little tweak to my function. I just use replace method to remove all spaces.
Playing Around
I started plugging in all sorts of names – my name, my friends’ names, even some random celebrity names. It was kind of fun to see what numbers popped out. I started to see if the numbers meant anything, or if there were any patterns. Of course, it’s all just for fun, but it was interesting to see the different values.
Wrapping Up
So, that was my little experiment for the day! It was a simple idea, but I had fun coding it up and seeing what happened. Not every coding session has to be about solving a huge problem. Sometimes, it’s just about exploring and playing around with ideas. I will to try some new ideas, like make a game or somthing. I save my code to my Github, and write the idea to my notebook!