trying to make a code that simulates a predator preyrelationship in python, however for some reason my code will notshow the plot, i cant find any issues with syntax or anything else,please help.
import matplotlib.pyplot as plt
predatorcount = []
preycount = [] Â Â
def simulate(initialpred, initialprey, preygrowth,predationrate, predshrink, predbirthrate):
predatorcount.append(initialpred)
preycount.appened(initialprey)
i=0;
prey = 1
predator = 1
while True:
prey =preycount[i]*(1+(preygrowth-predationrate*predatorcount[i]))
predator =predatorcount[i]*(1-(predshrink+predbirthrate*preycount[i]))
if prey <= 0 or predator <=0:Â Â
break;
else:Â Â
preycount.append(prey)
predatorcount.append(predator)
i = i+1
 Â
simulate(50, 1000, 0.25, 0.01, 0.05, 0.00002)
print(preycount[35])
plt.plot(range(35), predatorcount[35])
plt.plot(range(35), preycount[35])
 Â
plt.show()