Change each character in string to the next character in alphabet
<p>I am coding in Python 2.7 using PyCharm on Ubuntu.</p>

<p>I am trying to create a function that will take a string and change each character to the character that would be next in the alphabet.</p>

<pre><code>def LetterChanges(str):
    # code goes here
    import string
    ab_st = list(string.lowercase)
    str = list(str)
    new_word = []
    for letter in range(len(str)):
        if letter == "z":
            new_word.append("a")
        else:
            new_word.append(ab_st[str.index(letter) + 1])
        new_word = "".join(new_word)
    return new_word


# keep this function call here
print LetterChanges(raw_input())
</code></pre>

<p>When I run the code I get the following error:</p>

<pre><code>/usr/bin/python2.7 /home/vito/PycharmProjects/untitled1/test.py
test
Traceback (most recent call last):
  File "/home/vito/PycharmProjects/untitled1/test.py", line 17, in &lt;module&gt;
    print LetterChanges(raw_input())
  File "/home/vito/PycharmProjects/untitled1/test.py", line 11, in LetterChanges
    new_word.append(ab_st[str.index(letter) + 1])
ValueError: 0 is not in list

Process finished with exit code 1
</code></pre>

<p>What am I doing wroing in line 11? How can I get the following character in the alphabet for each character and append it to the new list?</p>

<p>Many thanks.</p>