title: Problem with Return function in Code Conversion Python
body: <p>Write a function file_in_english(filename, character_limit) that takes a filename (as a str) and a character_limit (as an int). The filename is the name of the file to convert from Code Latin to English and the character limit is the maximum number of characters that can be converted (including newline characters).</p>
  
  <p>The function should return a string that contains all the converted lines in the same order as the file </p>
  
  <p>If the limit is exceeded (ie, a converted sentence would take the output over the limit) then the sentence that takes the character count over the limit shouldn't be added to the output. A line with "&lt;>" should be added at the end of the output instead. The processing of lines should then stop.</p>
  
  <p>The lines in the file will each be a sentence in Code Latin and your program should print out the English version of each sentence </p>
  
  <p>Your function should keep adding sentences until it runs out of input from the file or the total number of characters printed (including spaces) exceeds the limit.</p>
  
  <ul>
  <li>You must include and call your english_sentence function. 
     You must NOT use the break statement anywhere in your code. 
     You MUST use while in your file_in_english function. You can only use one 
     return statement per function.</li>
  </ul>
  
  <p>The input text file has the following data:</p>
  
  <pre><code>aughterleeoow anmeeoow essaymeeoow onmeeoow heteeoow eaningmeeoow ofmeeoow 
  heteeoow omicceeoow ybeeoow enriheeoow ergsonbeeoow embermeeoow ofmeeoow  
  heteeoow institutemeeoow rofessorpeeoow atmeeoow   
  heteeoow ollegeceeoow edeeoow rancefeeoow authorisedmeeoow ranslationteeoow
  ybeeoow loudesleyceeoow reretonbeeoow .leeoow esmeeoow .leeoow (paris),meeoow 
  .a.meeoow (cantab)meeoow andmeeoow redfeeoow othwellreeoow .a.beeoow 
  (london)meeoow ranslators'teeoow refacepeeoow histeeoow ork,weeoow ybeeoow 
  rofessorpeeoow ergson,beeoow asheeoow eenbeeoow evisedreeoow inmeeoow 
  etaildeeoow ybeeoow heteeoow authormeeoow imself,heeoow andmeeoow heteeoow 
  resentpeeoow ranslationteeoow ismeeoow heteeoow onlymeeoow authorisedmeeoow 
  one.meeoow orfeeoow histeeoow 
  </code></pre>
  
  <p>Here's my program: <strong><em>(Expect Output different from my Output)</em></strong></p>
  
  <pre><code>def english_sentence(sentence):
  """Reverse Translation"""
  consonants = 'bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ'
  eng_sentence = [] 
  for coded_word in sentence.split():
      if coded_word.endswith("eeoow") and (coded_word[-6] in consonants):
          english_word = coded_word[-6] + coded_word[:-6]
          if (coded_word[-6] == 'm') and (coded_word[0] not in consonants):
              english_word = '(' + english_word + ' or ' + coded_word[:-6] + ')'
      eng_sentence.append(english_word)
  return " ".join(eng_sentence)
  
  def file_in_english(filename, character_limit):
  """English File"""
  space = ""
  newone = open(filename)
  nowline = newone.readline()  
  characters = 0
  while characters &lt; character_limit and nowline != "":
      process = nowline[0:-1]
      space += english_sentence(process)+'\n'
      characters += len(nowline)
      nowline = newone.readline()
  if characters &gt; character_limit:
      space += "&lt;&lt;Output limit exceeded&gt;&gt;"
  
  return space
  
  Test Case:
  ans = file_in_english('big_test.txt', 112)
  print(ans)
  
  &gt; Obtained Output:
  
  laughter
  (man or an) (messay or essay) (mon or on) the (meaning or eaning) (mof or 
  of) the comic by henri bergson
  &lt;&lt;Output limit exceeded&gt;&gt;
  
  Exected Output:
  laughter
  (man or an) (messay or essay) (mon or on) the (meaning or eaning) (mof or of)   the comic &lt;&lt;Output limit exceeded&gt;&gt;
  
  Test Case 2: 
  
  ans = file_in_english('big_test.txt', 8)
  print(ans)
  
  Obtained Output:
  laughter
  &lt;&lt;Output limit exceeded&gt;&gt;
  
  EXPECTED Output:
  &lt;&lt;Output limit exceeded&gt;&gt;
  </code></pre>
  
  <p>Please advise where I am going wrong. </p>