import pygame import sys pygame.init() displaysurface = pygame.display.set_mode((400,300)) pygame.display.set_caption("Task4") while True: events = pygame.event.get() for event in events: if event.type == pygame.QUIT: pygame.quit() sys.exit() pygame.display.update()