How to find the index of all letters in a user inputted string
<p>This is the assignment:
Write a program that gets a single word from the user. For each letter in the word, print the index of that letter in the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' (e.g., 'A' would print 0, 'z' would print 51). Print all the indices on one line, separated by spaces.</p>

<pre><code>alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'

word = input('Type a word: ')

for ind in word:
    answer = ind.index(alphabet[0,-1])
    print(answer)
</code></pre>

<p>My code does not run. It says "TypeError: string indices must be integers". 0 and -1 are both integers, and they indicate the first and last positions of a given string. I don't understand why this is not running properly. The code should take alphabet at position 0, see that there is no matching value in word, and then move on to the next one until it reaches the first character's position in the typed string. It should then print out that number, and keep going. What am I doing wrong?</p>