title: Python -- pygame error 'str object has not attribute 'render'
body: <p>I am building a hangman game in python, and for some reason, when trying to display a game over message in the function def drawGameOver, i get the following error: "'str' object has no attribute 'render'". What is wrong with the code i have? How would i go about displaying "Game Over" towards the bottom middle of the screen? I've given what i believe to be the only relevant code. The error is for the line directly below the "#display game over message" comment. Thanks!</p>
  
  <pre><code># this function draws the game over screen    
  def drawGameOver(screen, fontObj, gameOverMsg, secretWord):
  # draw a filled rectangle
  pygame.draw.rect(screen,(0,0,255),(0,375,640,100))
  # draw a border rectangle
  # display the game over message
  overMsg = fontObj.render(gameOverMsg, True, (255,255,255),(0,0,0))
  overRect = overMsg.get_rect()
  screen.blit(overMsg,overRect)
  # display the secret word
  print("")
  
  def main():
  # initialize pygame
  pygame.init()
  # create the screen
  screen = pygame.display.set_mode((640,440))
  # fill the screen w/ white
  screen.fill((255,255,255))
  
  fontObj = pygame.font.SysFont('bookantiqua', 28, True, False)
  # here is the magic: making the text input
  # create an input with a max length of 45,
  # and a red color and a prompt saying 'type here: '
  txtbx = eztext.Input(x=0, y=350, color=(0,0,0), prompt='You entered: ')
  
  # get the secret word
  secretWord = getRandomWord(words)
  #variables to hold the incorrect and correct letters
  missedLetters = ""
  correctLetters = ""
  #gameoverMsg is initialized to be empty
  gameOverMsg = "Game Over"
  #game is not over yet
  gameIsDone = False
  </code></pre>