语法错误Python:意外缩进

语法错误Python:意外缩进,python,pygame,Python,Pygame,我最近开始学习Python。我无法解决此错误: import pygame, sys from pygame.locals import * pygame.init() DISPLAYSURF = pygame.display.set_mode((400, 300)) pygame.display.set_caption('Hello World!') while True: for event in pygame.event.get(): if event.typ

我最近开始学习Python。我无法解决此错误:

import pygame, sys
from pygame.locals import *

pygame.init()

DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')

while True:
    for event in pygame.event.get():
        if event.type == QUIT:

        pygame.quit()
        sys.exit()

        pygame.display.update()
我得到一个错误,上面写着

意外缩进

右移此部分:

pygame.quit()
sys.exit()

我投票结束这个问题,因为它不是英文的。我:正如错误信息所说,你的代码没有正确缩进。您应该将错误消息作为文本而不是链接图像放入问题中。谢谢!接下来我用英语提问。在匹配
if
之后要执行的语句应该进一步缩进,所以可能是接下来的两行代码。