我的代码出现以下错误。 有人能帮我吗
代码如下
def askforinteger():
while True:
try:
a = int(input("enter an integer")
except Exception as e :
print("there is a error of", e)
else:
print("person has entered correct input")
break
finally:
print("clsoe this issue")
错误如下
File "<ipython-input-5-234fd49c196d>", line 5
except Exception as e :
^
SyntaxError: invalid syntax
您有错误语法:
您忘记在属性中添加括号
希望这能解决它 试试这个:
相关问题 更多 >
编程相关推荐