title: 'return' outside function
body: <p>Why is this giving me the error <code>'return' outside function</code>?</p>
  
  <pre><code>Result = ""
  char = ""
  
      # Let char loop over each character in the input string
  
  a = list(s)
  for i in range (0, len(s)):
  
          # If this char is a letter:
  
      if (type(a[i])=='str'):
  
              # Set char_low to be char converted to lower case
  
          char_low = a.lower()
          print a
  
              # Note: the next 5 lines do not need to be changed -
              #  they will modify the character as necessary
      if char_low &lt;= 'm':
          dist = 13
      else:
           dist = -13
      char = chr(ord(char) + dist)
          # Push char onto the end of the result
  
      result = result + char
  
      # Return the encrypted text
  
  return result
  </code></pre>