Numerology with certain rules
<p><strong>The challenge is to :</strong>
Create a function name_numerology(name) which takes input and turns this input into single digit value and then returns it.</p>

<p><strong>The rules are:</strong></p>

<ul>
<li>function must ignore all kind of characters that are not in the list
of letters above, treat them as something that matches value 0</li>
<li>function must be able to handle the case where input is not string</li>
<li>function must do it's job despite that input might consist of both<br>
lower or upper case letters </li>
<li>if sum of letters is too big (over 10), then the sum the digits
of the sum until the value is number between 0 and 10. Ex: total
is 99 => 9 + 9 => 18 => 1 + 8 = 9. 9 is valid</li>
</ul>

<p>Can't figure out the rest. I am stuck, help please.</p>

<pre><code>letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    numbers = '12345678912345678912345678'
    def name_numerology(name):
            if isinstance(name, str):
                name = str(name)
                name = name.upper()
                summed = 0
                for i in name:
                        if i not in letters:
                                i = 0
                        else:
                                a = letters.index(i)
                                summed += int(numbers[a])
                                ha, hu = divmod(summed, 10)
                return ha+hu
            else:
                   return 'Please enter a name'
</code></pre>

<p>I think the purpose is that you start adding digits only after you have processed all input characters:</p>

<pre><code>letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
numbers = '12345678912345678912345678'
def name_numerology(name):
    if not isinstance(name, str):
       return 'Please enter a name'
    summed = 0
    for c in name.upper():
        a = letters.find(c)
        if a &gt; -1:
            summed += int(numbers[a])
    while summed &gt; 9:
        temp = summed
        summed = 0
        while temp &gt; 0:
            temp, digit = divmod(temp, 10)
            summed += digit
    return summed

result = name_numerology('JackTheRipper')
print(result)
</code></pre>

python python-3.x