title: Why does python keep saying the return statement is outside of the function?
body: <pre><code>single_char = {}
  for item in lines:
      for index in range(len(item)):
          if item[index - 1] in space:
              if item[index + 1] in space:
                  if item[index] in alplist:
                      char = item[index]
                      single_char[char] = index
                      return single_char
                  else:
                      continue
              else:
                  continue
          else:
              continue​
  </code></pre>
  
  <p>This is my function by for some reason Python keeps telling me that the return statement "return single_char" is outside of the function. Can somebody please explain how i can fix this problem. </p>