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)”)