Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 当我运行代码时,它会给我一个缩进错误,为什么_Python 3.x_Indentation - Fatal编程技术网

Python 3.x 当我运行代码时,它会给我一个缩进错误,为什么

Python 3.x 当我运行代码时,它会给我一个缩进错误,为什么,python-3.x,indentation,Python 3.x,Indentation,当我编译这段代码时,它给了我一个错误 import pygame, sys, random, time check_errors=pygame.init() if check_errors[1]!=0: print("(!) Had {0} initializing errors, exiting...".format(check_errors[1])) sys.exit(-1) #ON this line says:IndentationError: unindent d

当我编译这段代码时,它给了我一个错误

import pygame, sys, random, time

check_errors=pygame.init()

if check_errors[1]!=0:
    print("(!) Had {0} initializing errors, exiting...".format(check_errors[1]))
    sys.exit(-1) #ON this line  says:IndentationError: unindent does not match any outer indentation level
else:
    print("(+) PyGame successfully initialized!")
我尝试了一些东西,但无法使它工作,我是一个新手,你可以看到。
编辑:这不是问题,我打错了…

导入行1前有一个“”。

检查第一行。它是“导入pygame,sys,random,time”,而不是
import pygame,sys,random,time