title: Letter Change using Python
body: <p>Problem statement: </p>
  
  <blockquote>
    <p>Have the function <code>LetterChanges(str)</code> take the str parameter being passed and modify it using the following algorithm. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a). Then capitalize every vowel in this new string (a, e, i, o, u) and finally return this modified string. </p>
  </blockquote>
  
  <p>My Python program is:</p>
  
  <pre><code>def LetterChanges(str):
      for i in range(0,len(str)):
          a=ord(str[i])
          if a==122:
              str=str.replace(str[i],'a',1)
          elif a==90:
              str=str.replace(str[i],'a',1)
          elif (a&gt;=65 and a&lt;=90) or (a&gt;=97 and a&lt;=122):
              a=a+1
              char=chr(a)
              str=str.replace(str[i],char,1)
      for i in range(0,len(str)):
          if str[i]=='a':
              str=str.replace(str[i],'A',1)
          elif str[i]=='e':
              str=str.replace(str[i],'E',1)
          elif str[i]=='i':
              str=str.replace(str[i],'I',1)
          elif str[i]=='o':
              str=str.replace(str[i],'O',1)
          elif str[i]=='u':
              str=str.replace(str[i],'U',1)
      return(str)
  
  print LetterChanges(raw_input())
  </code></pre>
  
  <p>The problem with my code is that, when I input <code>sen</code>, the output was <code>tfo</code> which was correct.</p>
  
  <p>But when I gave <code>sent</code> as my input, I got the wrong output.</p>