Need help assiigning numbers to letters in python
<p><a href="http://i.stack.imgur.com/SuSs7.png" rel="nofollow">This is a a plan of  what i want to do with the code.</a></p>

<p>This is all i have to offer, I'm not sure if it's correct.</p>

<pre><code>input ("What's your name?")
[A,J,S]=1
[B,K,T]=2
[C,L,U]=3
[D,M,V]=4
[E,N,W]=5
[F,O,X]=6
[G,P,Y]=7
[H,Q,Z]=8
[I,R]=9
</code></pre>

<ul>
<li><p>Input a personâs name</p></li>
<li><p>Calculate their lucky name number using the grid in Figure 1 above</p></li>
<li><p>Display the names</p></li>
<li><p>Display the lucky name number</p></li>
</ul>

<p>Firstly, the input value needs to be assigned to a variable. So instead of doing</p>

<pre><code>input ("What's your name?")
</code></pre>

<p>You should write</p>

<pre><code>input_text = input("What's your name?")
</code></pre>

<p>This will store the user's input to the string variable input_text.</p>

<p>Next, we will need to declare a dictionary to map each letter to its number.</p>

<pre><code>alpha_map = {'A': 1, 'B': 2, 'C': 3}  # And so on until 'Z' 
</code></pre>

<p>After we have done this, we can iterate through each character of input_text and grab its value from the dictionary.</p>

<pre><code>alpha_values = []  # An empty list
for character in input_text:
    alpha_values.append(alpha_map[character])  # Adds each character's value to alpha_values.
</code></pre>

<p>You can use the sum() function to sum up the list of values.</p>

<p>As for adding up the digits, you could convert the resulting number into a string and convert each character to an int before summing up.</p>

<pre><code>total = 0
for character in str(number):
    total += int(character)
</code></pre>

<p>Note that you will have to strip the input text of any non-alphabetical characters, and capitalize all letters for this program to run - there are already plenty of online documentations explaining how to do this.</p>

python python-3.x