我希望我的程序询问用户是否想再次使用它(即重新启动)。我如何在 Python 3.3 中做到这一点?
我试过这个
loop=1
while(loop==1):
#code
loop-=1
done=0
while(done==0):
choice=input("Do you want to restart?(Y/N)")
choice1=choice.upper()
if(choice1=="Y"):
loop+=1
done=1
print("Restarting...")
elif(choice1=="N"):
done=1
print("The program will now END. Thank you for using the program.")