我有一个错误:
“回溯(最近一次调用最后一次):文件“C:\Python27\Lib\idlelib\Task4”,第 13 行,在 if (y[i]-3)
使用以下代码:
from numpy import*
from matplotlib import pyplot
import random
Player1 = raw_input("Player 1 Name:")
Player2 = raw_input("Player 2 Name:")
pyplot.axis([0,8000,0,200])
a = random.randint(0,101)
x = range(8000)
y = [a]`enter code here`
i=0
while i<len(x):
b = random.randint(0,101)
if (y[i]-3)<b and b<(y[i]+3):
y.append(b)
i+=1
pyplot.plot(x,y)
pyplot.show()
请帮忙!谢谢!