2016-03-08 52 views
-4

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

+2

我投票关闭这个问题进行摘因为它不是英文 – smirkingman

+4

仅供参考:http://pt.stackoverflow.com –

+1

正如错误消息所述,您的代码没有正确缩进。您应该将错误消息作为文本放入问题中,而不是作为链接的图像。 –

回答

0

向右移动,这部分的错误:

pygame.quit() 
sys.exit()