语法错误Python:意外的索引

2024-04-19 10:15:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我最近开始学习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()

我得到一个错误

unexpected indent


Tags: fromimporteventhelloworldinitmode错误