Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/364.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 变量表示它';它没有定义,但它是_Python_Python 3.x_Variables_Defined - Fatal编程技术网

Python 变量表示它';它没有定义,但它是

Python 变量表示它';它没有定义,但它是,python,python-3.x,variables,defined,Python,Python 3.x,Variables,Defined,错误信息: Traceback (most recent call last): File "C:/Users/ADMIN/Desktop/python/footballcomplex.py", line 85, in <module> if input2 == 'a': NameError: name 'input2' is not defined input2 = input("Would you like to long pass to 3(a) or throu

错误信息:

Traceback (most recent call last):
  File "C:/Users/ADMIN/Desktop/python/footballcomplex.py", line 85, in <module>
    if input2 == 'a':
NameError: name 'input2' is not defined
input2 = input("Would you like to long pass to 3(a) or through ball to 2(b)")

if input2 == 'a':
如果您现在想阅读全部内容:

代码链接

问题是当我把b或c作为第一个a,b和c的问题时,a的效果非常好

请帮忙,我真的不知道。
Python 3.7版

删除第83行之前的缩进

input2 = input("Would you like to long pass to 3(a) or through ball to 2(b)")
在它前面的if语句中

if input1 == 'a':

现在,当input1=='a'时,它只要求输入,但如果你去掉缩进,它将要求输入,而不管input1

如何,对
input
的调用是前面代码中
if
-块的一部分。缩进几乎是不可见的,因为缩进只有一个空格。看在上帝的份上,请尊重并使用四个空格缩进每个级别。“…但它是。”不,它不是。您在input1的if条件下通过了input2,请删除语句前的多余空格,input2=input(“您想长传球到3(a)还是通过球到2(b)”)