Python 3.3程序不工作?
我现在已经用Python编写了一些程序,但我还是相当新的。我已经升级到3.3了,我的大部分程序都坏了。我现在已经用Python 3.3程序不工作?,python,python-3.3,Python,Python 3.3,我现在已经用Python编写了一些程序,但我还是相当新的。我已经升级到3.3了,我的大部分程序都坏了。我现在已经用输入替换了所有原始输入,但这仍然不起作用,而且我没有收到任何错误 你们中的一位优秀程序员能帮忙吗 a = 1 while a < 10: StartQ = input("Would you like to Start the program, or Exit it?\n") if StartQ == "Exit": break elif
输入
替换了所有原始输入
,但这仍然不起作用,而且我没有收到任何错误
你们中的一位优秀程序员能帮忙吗
a = 1
while a < 10:
StartQ = input("Would you like to Start the program, or Exit it?\n")
if StartQ == "Exit":
break
elif StartQ == "Start":
AMSoD = input("Would you like to Add, Multiply, Subtract or Divide?\nPlease enter A, M, S or D.\n")
if AMSoD == "A":
Add1 = input("Add this: ")
Add2 = input("By this: ")
AddAnswer = int(Add1) + int(Add2)
AAnswer = Add1 + " " + "+" + " " + Add2 + " " + "=",AddAnswer
print(AAnswer)
print("The answer is:"),AddAnswer
elif AMSoD == "M":
Mul1 = input("Multiply this: ")
Mul2 = input("By this: ")
MulAnswer = int(Mul1) * int(Mul2)
MAnswer = Mul1 + " " + "*" + " " + Mul2 + " " + "=",MulAnswer
print(MAnswer)
print("The answer is:"), (MulAnswer)
elif AMSoD == "S":
Sub1 = input("Subtract this: ")
Sub2 = input("From this: ")
SubAnswer = int(Sub2) - int(Sub1)
SAnswer = Sub2 + " " + "-" + " " + Sub1 + " " + "=",SubAnswer
print(SAnswer)
print("The answer is:"), (SubAnswer)
elif AMSoD == "D":
Div1 = input("Divide this: ")
Div2 = input("By this: ")
DivAnswer = int(Div1) / int(Div2)
DAnswer = Div1 + " " + "/" + " " + Div2 + " " + "=",DivAnswer
print(DAnswer)
print("The answer is:"), (DivAnswer)
DivQoR = input("Would you like to Quit or restart?\nAnswer Quit or Restart.\n")
if DivQoR == "Restart":
a = 1
elif DivQoR == "Quit":
DivQoRAyS = input("Are you sure you want to quit? Answer Yes or No.\n")
if DivQoRAyS == "Yes":
break
elif DivQoRAyS == "No":
a = 1
a=1
而a<10:
StartQ=input(“要启动程序还是退出程序?\n”)
如果StartQ==“退出”:
打破
elif StartQ==“开始”:
AMSoD=input(“您想加、乘、减还是除?\n请输入A、M、S或D。\n”)
如果AMSoD==“A”:
Add1=输入(“添加此:”)
Add2=输入(“由此:”)
AddAnswer=int(Add1)+int(Add2)
AAnswer=Add1++++++++++++Add2++=,AddAnswer
打印(AAnswer)
打印(“答案是:”),添加答案
elif AMSoD==“M”:
Mul1=输入(“乘以此:”)
Mul2=输入(“通过此:”)
MulAnswer=int(Mul1)*int(Mul2)
MAnswer=Mul1++“*”++“+Mul2++“=”,MulAnswer
印刷品(MAnswer)
打印(“答案是:”),(穆兰斯wer)
elif AMSoD==“S”:
Sub1=输入(“减去此:”)
Sub2=输入(“来自此:”)
SubAnswer=int(Sub2)-int(Sub1)
SAnswer=Sub2+“”+“”-“+“”+Sub1+“”+“”=”,子电源
打印(SAnswer)
打印(“答案是:”),(副回答)
elif AMSoD==“D”:
Div1=输入(“除以此:”)
Div2=输入(“由此:”)
DivAnswer=int(Div1)/int(Div2)
DAnswer=Div1++/+++Div2++=DivAnswer,DivAnswer
印刷品(丹麦)
打印(“答案是:”),(DivAnswer)
DivQoR=input(“您想退出还是重新启动?\n关机退出或重新启动。\n”)
如果DivQoR==“重新启动”:
a=1
elif DivQoR==“退出”:
DivQoRAyS=input(“您确定要退出吗?回答是或否。\n”)
如果DivQoRAyS==“是”:
打破
elif divqoraries==“否”:
a=1
将所有要打印的项目放入print()函数调用的括号中。
函数调用:
print("The answer is:", AddAnswer)
及
等等
在构建字符串的地方,在print()
函数中构建字符串会更容易。而不是
AAnswer = Add1 + " " + "+" + " " + Add2 + " " + "=",AddAnswer
print(AAnswer)
(如果忘记将最后一个逗号替换为+
),请执行以下操作:
print(Add1, '+', Add2, '=', AddAnswer)
其他选项依此类推。将所有要打印的项目放入print()
函数调用的括号中:
print("The answer is:", AddAnswer)
及
等等
在构建字符串的地方,在print()
函数中构建字符串会更容易。而不是
AAnswer = Add1 + " " + "+" + " " + Add2 + " " + "=",AddAnswer
print(AAnswer)
(如果忘记将最后一个逗号替换为+
),请执行以下操作:
print(Add1, '+', Add2, '=', AddAnswer)
其他选项依此类推。将所有要打印的项目放入print()
函数调用的括号中:
print("The answer is:", AddAnswer)
及
等等
在构建字符串的地方,在print()
函数中构建字符串会更容易。而不是
AAnswer = Add1 + " " + "+" + " " + Add2 + " " + "=",AddAnswer
print(AAnswer)
(如果忘记将最后一个逗号替换为+
),请执行以下操作:
print(Add1, '+', Add2, '=', AddAnswer)
其他选项依此类推。将所有要打印的项目放入print()
函数调用的括号中:
print("The answer is:", AddAnswer)
及
等等
在构建字符串的地方,在print()
函数中构建字符串会更容易。而不是
AAnswer = Add1 + " " + "+" + " " + Add2 + " " + "=",AddAnswer
print(AAnswer)
(如果忘记将最后一个逗号替换为+
),请执行以下操作:
print(Add1, '+', Add2, '=', AddAnswer)
其他选项也是如此