如何打印问题回答错误的次数?
while 1:
math = input("(1) What Is 8 x 4 : ")
if not math.isdigit():
print("It's not number")
elif math == "32":
print("You Got The Question Correct")
break
else:
print("Sorry You Got The Question Wrong Try Again")
答案 0 :(得分:1)
打印值
wrongTry = 0 #read 1.
while 1:
math = input("(1) What Is 8 x 4 : ")
if not math.isdigit():
print("It's not number")
wrongTry = wrongTry + 1 #read 2.
elif math == "32":
print("You Got The Question Correct")
break
else:
print("Sorry You Got The Question Wrong Try Again")
wrongTry = wrongTry + 1 #read 2.
print(wrongTry) #read 3.