感谢您阅读
我想让我的网站再次运作。我在webhost上运行它而不是虚拟服务器。下面的代码是我目前正在使用的.htaccess。
import random
import operator
from operator import add, sub, mul
from random import randint
score = 0
name = input("What is your name? ")
for i in range(10):
n1 = randint(1,10)
n2 = randint(1,10)
ops =[["+", operator.add],["-", operator.sub],["*", operator.mul]]
randomOp = random.choice(list(ops))
operator = randomOp[0]
op = randomOp[1]
prod = op(int(n1), int(n2))
ask = ("What is",int(n1),operator,int(n2),"?")
ans = input(ask)
if ans == ("%d" % (prod)):
print ("That's right -- well done")
score = score + 1
else:
print ("No, The answer is %d. " % (prod))
print (name, "I asked you 10 questions. You got %d of them right." % (score))
print ("Quiz is finished")
导致内部服务器错误。我不知道如何解决这个问题。有人能帮我这个吗?
答案 0 :(得分:1)
1,在规则4中的[]
之前的行和空格的末尾删除括号?
。可能,结果将是正确的:)