title: Is there a function to stop printing something in Python?
body: <p>I am trying to code a program that finds searches for a string in a text file, and if the given string is within the text file, it shows 'That nickname is taken.' However, after each line which no text has been entered, a line of irrelavant text shows. Here is my code:`</p>
  
  <pre><code>nick_idea = input('Nickname idea: ')
  if nick_idea in open('class.txt').read():
      print ('That name is already taken!')
  else:
      print('Great Name!')
  while nick_idea != '':
      nick_idea = input('Nickname idea: ')
      if nick_idea in open('class.txt').read():
          print ('That name is already taken!')
      else:
          print('Great Name!')`
  </code></pre>