AB-B =“)如果回答== 1035: 打印(“正确”)其他: 打印(“不正确”) 打印(“答案是1035”)def Math(): 打印(玛他()) 返回def Science(): 返回
高清 农业 </跨度> 问题“,fg =”red“,命令=数学)Button2 = Button(Frame2,text =“Science Questions”,fg =“blue”,command = Science)Button3 = Button(Frame3,text =“Agricultural Questions”,fg =“green”,command = 农业 </跨度>
改变这个:
def MathA(): print("If A=12*2 and B=15*3, What does AB-B= ") answer = input() answer = int(answer) if answer == 1035: print("Correct") else: print("Incorrect") print("The Answer was 1035")
和:
def Math(): MathA() return