python程序出错
fromrandomimportchoicet=range(0,552)whileTrue:t[0*28]=(134.14+t[1]+t[29])/4q_numbers=...
from random import choicet = range(0,552)while True: t[0*28] = (134.14+t[1]+t[29])/4 q_numbers = range(1,28) for q in q_numbers: t[q] = (t[q-1]+t[q+1]+t[q+29]+80)/4 t[1*28] = (134.14+t[27]+t[28*2])/4 p_numbers = range(1,28) w_numbers = range(2,18) for w in w_numbers: t[(w-1)*28+1] = ((60+t[(w-2)*28]+t[w*28+1]+t[(w-1)*28+2])/4 for p in p_numbers: t[p+28*(w-1)] = (t[p+28*(w-1)-1]+t[p+28*(w-1)+1]+t[p+28*(w-1)+29]+t[p+28(w-1)-29])/4 t[w*28] = ((60+t[(w-1)*28]+t[(w+1)*28]+t[w*28-1])/4 t[523] = (120+t[524]+t[494])/4 for k in k_numbers: t[k*18] = (60+t[k*18-1]+t[k*18+1]+t[k*18-29])/4 t[551] = (120+t[550]+t[522])/4 print t麻烦大神帮我看看!非常感谢
展开
展开全部
非常遗憾,虽然我把语法错误都调通了,运行时候发现是死循环
还有不知道程序的功能,一些代码缩进和k_numbers的赋值你还需要在看一下
t = [0 for i in range(0,552)]
while True:
t[0*28] = (134.14+t[1]+t[29])/4
q_numbers = range(1,28)
for q in q_numbers:
t[q] = (t[q-1]+t[q+1]+t[q+29]+80)/4
t[1*28] = (134.14+t[27]+t[28*2])/4
p_numbers = range(1,28)
w_numbers = range(2,18)
for w in w_numbers:
t[(w-1)*28+1] = (60+t[(w-2)*28]+t[w*28+1]+t[(w-1)*28+2])/4
for p in p_numbers:
t[p+28*(w-1)] = (t[p+28*(w-1)-1]+t[p+28*(w-1)+1]+t[p+28*(w-1)+29]+t[p+28*(w-1)-29])/4
t[w*28] = (60+t[(w-1)*28]+t[(w+1)*28]+t[w*28-1])/4
t[523] = (120+t[524]+t[494])/4
k_numbers = range(1,28)
for k in k_numbers:
t[k*18] = (60+t[k*18-1]+t[k*18+1]+t[k*18-29])/4
t[551] = (120+t[550]+t[522])/4
print(t)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询