当“再次”得到“Y”或“y”时,我如何让这个程序重复?昨天同样的代码工作 smh,但今天它关闭了我在那里写的任何程序)是的......制表是错误的但这是因为 stackoverflow 以某种奇怪的方式复制了它 :))
while True:
start = input("What do you want to do? + - * / ")
if start == '+':
x = float(input("digit 1 "))
y = float(input("digit 2 "))
res = x + y
print('The result is ' + str(res))
again = input('Do u want to try again? Y/N ')
if again == 'N' or 'n':
break
呼啦一阵风
侃侃尔雅
随时随地看视频慕课网APP
相关分类