请问如何开始一个新的shell prompt?

问题遇到的现象和发生背景

一敲回车就运行了while代码,但整个代码还没写完

问题相关代码,请勿粘贴截图

x=int(input('please enter an integer: '))
please enter an integer: -4567
episilon=0.01
numGuesses=0
low=0.0
high=max(0,abs(x))
ans=(high+low)/2
while abs(ans3-abs(x))>=episilon:
print('low=',low,'high=',high)
numGuesses+=1
if ans
3<abs(x):
low=ans
else:
high=ans
ans=(high+low)/2

low= 0.0 high= 4567
low= 0.0 high= 2283.5
low= 0.0 high= 1141.75
low= 0.0 high= 570.875
low= 0.0 high= 285.4375
low= 0.0 high= 142.71875
low= 0.0 high= 71.359375
low= 0.0 high= 35.6796875
low= 0.0 high= 17.83984375
low= 8.919921875 high= 17.83984375
low= 13.3798828125 high= 17.83984375
low= 15.60986328125 high= 17.83984375
low= 15.60986328125 high= 16.724853515625
low= 16.1673583984375 high= 16.724853515625
low= 16.44610595703125 high= 16.724853515625
low= 16.585479736328125 high= 16.724853515625
low= 16.585479736328125 high= 16.655166625976562
low= 16.585479736328125 high= 16.620323181152344
low= 16.585479736328125 high= 16.602901458740234
low= 16.585479736328125 high= 16.59419059753418
low= 16.589835166931152 high= 16.59419059753418
low= 16.589835166931152 high= 16.592012882232666
low= 16.59092402458191 high= 16.592012882232666
low= 16.59092402458191 high= 16.591468453407288
low= 16.59092402458191 high= 16.5911962389946
low= 16.591060131788254 high= 16.5911962389946
if x<0:
ans=-ans
print(ans)
else:
print(ans)

-16.591162212193012

运行结果及报错内容

提前运行了while

img

我的解答思路和尝试过的方法

想问一下是什么原因

我想要达到的结果

vscode解决所有问题