title: pygame 'screen' not defined
body: <p>Following the Python Crash Course, I copied this input and ran it with an error </p>
  
  <pre><code>import os
  import pygame
  def play_game():
      #Creates Screen
      resolution = pygame.display.set_mode((1920, 1080))
      pygame.init()
      pygame.display.set_caption('Game')
      #Colors the background
      bg_color = (230,230,230)
      #Starts the game
      while True:
          #Sets background color
          screen.fill(bg_color)
          #Looks for user inputs
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  sys.exit()
  
                  #updates the screen
                  pygame.display.flip()
  
  
  
  play_game()
  </code></pre>
  
  <p>The error reads:</p>
  
  <blockquote>
    <p>NameError: name 'screen' is not defined</p>
  </blockquote>
  
  <p>How do I fix this? I believe I installed pygame and pip correctly.</p>