title: How do I exclude the last line of user input?
body: <p>I'm trying to get user inputs to write a file at run time. But it writes the delimiter (<code>-99</code>) also. Is there any simpler code rather than this one without including delimiter?</p>
  
  <p>In the past, I've tried on Python 3 in Jupyter lab.</p>
  
  <pre><code>lines=input("Enter the contents:")
  while(lines!="-99"):
      lines=input()
      file.write(lines)
      file.write("\n")
  file.close()
  </code></pre>
  
  <p>I expect the output of user contents upto <code>-99</code> (that is, excluding <code>-99</code>), but the actual output is user contents with <code>-99</code>.</p>
  
  <p><strong>Sample Output</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Enter the contents:
   Hi
   Hello
   Welcome to python lab
  -99
  </code></pre>
  
  <p>In my output file:</p>
  
  <pre class="lang-none prettyprint-override"><code> Hi
   Hello
   Welcome to python lab
  -99
  </code></pre>