title: Crazy Challenge: Rotating Letters in Python Encipher Function
body: <p>I'm trying to write a function <code>rot(c,n)</code> that rotates a single character c forward by n spots in the alphabet.</p>
  
  <pre><code>def rot(c,n):
  """ rotate c forward by n characters,
      wrapping as needed; only letters change
  """
  
  if 'a' &lt;= c &lt;= 'z':          # lower-case
      new_ord = ord(c) + n
      if new_ord &gt; ord('z'):
          new_ord = new_ord - (2*n)
  elif 'A' &lt;= c &lt;= 'Z':        # upper-case
      new_ord = ord(c) + n 
      if new_ord &gt; ord('Z'):
          new_ord = new_ord - (2*n)
  
  else:                        # non-alpha
      new_ord = ord(c)
  return chr(new_ord)
  </code></pre>
  
  <p>However my desired outputs are as follow:</p>
  
  <pre><code>&gt;&gt;&gt; rot('a', 2)
  'c'
  &gt;&gt;&gt; rot('y', 2)
  'a'
  &gt;&gt;&gt; rot('A', 3)
  'D'
  &gt;&gt;&gt; rot('Y', 3)
  'B'
  &gt;&gt;&gt; rot('!', 4)
  '!'
  </code></pre>
  
  <p>I keep getting the wrong outputs. Can someone tell me what I'm doing wrong?</p>