如何修复缩进错误?当我要填充颜色时

问题描述 投票:0回答:1

我是python的初学者,

我有此错误:

unindent does not match any outer indentation level (<unknown>, line 24) 

这是我的代码:

  import pygame

#get screen
screen = pygame.display.set_mode((800, 600))

#Set title and logo
pygame.display.set_caption('Space Invaders')
icon = pygame.image.load('spaceship.png')
pygame.display.set_icon(icon)


#Running
running = True
while running:
    import pygame

    for event in pygame.event.get():

        if event.type == pygame.QUIT:
            running = False

  screen.fill((155 , 0, 0))
  pygame.display.update() 

我试图用颜色填充屏幕,但始终出现以上错误。请帮助我解决此问题。

match indentation outer-join
1个回答
0
投票
如错误消息所述,您正在缩进行:
© www.soinside.com 2019 - 2024. All rights reserved.