我在else中不断遇到语法错误-如果用户输入错误,需要帮助Python创建向量计算器吗
我在else中不断遇到语法错误-如果用户输入错误,需要帮助Python创建向量计算器吗,python,Python,中断外部循环,不良缩进,进入内部,同时循环: if force > 1: try: force = int(input("\033[2;0H Force (numbers only): ")) except ValueError: print("that's not a real number") continue else: break 继续应相应地加入但indent@
中断
外部循环,不良缩进,进入内部,同时
循环:
if force > 1:
try:
force = int(input("\033[2;0H Force (numbers only): "))
except ValueError:
print("that's not a real number")
continue
else:
break
继续
应相应地加入但
indent@Tomerikoo-试试
除了
以外
是有效的python语法。@MichaelSzczesny确实如此!!!我画得太快了。谢谢
while True:
try:
force = int(input("\033[2;0H Force (numbers only): "))
except ValueError:
print("that's not a real number")
continue
else:
break