Python: Converting word to list of letters, then returning indexes of the letters against lower case alphabet
<p>I have already completed the task but in its most basic form looking for help shortening it and so it can apply to any word not just one with eight letters, here's what I've got so far (bit long for what it does):</p>

<pre><code>alpha = map(chr, range(97, 123))
word = "computer"
word_list = list(word)

one = word[0]
two = word[1]
three = word[2]
four = word[3]
five = word[4]
six = word[5]
seven = word[6]
eight = word[7]


one_index = str(alpha.index(one))
two_index = str(alpha.index(two))
three_index = str(alpha.index(three))
four_index = str(alpha.index(four))
five_index = str(alpha.index(five))
six_index = str(alpha.index(six))
seven_index = str(alpha.index(seven))
eight_index = str(alpha.index(eight))

print (one + "=" + one_index)
print (two + "=" + two_index)
print (three + "=" + three_index)
print (four + "=" + four_index)
print (five + "=" + five_index)
print (six + "=" + six_index)
print (seven + "=" + seven_index)
print (eight + "=" + eight_index)
</code></pre>

<p>Just an alternative way:</p>

<pre><code>for w in word:
    print (w+" = "+str((ord(w.lower())-96))) if w not in '., !' else ""
</code></pre>

<p>This way is not case sensitive, for example for <code>Computer</code> you will get the same results as with <code>computer</code>, but the output is case sensitive (I mean even if the index remains the same for capitals and lowers the letters printed in the output will be as in the word) .</p>

python string list