title: How to stop an extra trailing newline character?
body: <p>This is my code:</p>
  
  <pre><code>line = 'hi'
  while line != '':
      line = input('Sentence: ')
      if '!' in line:
          if list(line)[0] == '!':
              reversed_text = ''
              last_index = len(line) - 1
              for i in range(last_index, -1, -1):
                  reversed_text += line[i]
              print(reversed_text)
          else:
              print(line)
      else:
          print(line)
  </code></pre>
  
  <p>It seems to be adding an extra blank line when the user inputs nothing, and I'm not sure how to stop it. Any suggestions?</p>