I have some Pygame code that is working fine up until I try to close the program. The program keeps telling me that sys is not defined. I am using the more python programming for the absolute beginner to get the hang of Pygame.
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((600,500))
while True:
for event in pygame.event.get():
if event.type == QUIT:
sys.exit()
My expected result is that the window will close but instead the window stays open and this error is spat out: NameError: name 'sys' is not defined