该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
其实那个list 是从一个txt中读取的数据,一个有4个数字。分别是RABBIT_BIRTH_RATE, FOX_BIRTH_RATE, INTERACT, SUCCESS, 他们应该等于什么,才能进行后面的运算?
作业还要求导出一个txt,把结论写进去
我的完整代码:
def main():
rabbits = int(input("\nPlease enter the initial rabbit population: "))
foxes = int(input("Please enter the initial foxes population: "))
num_days = int(input("Please enter the number of days to run the simulation: "))
fre_days = int(input("Please enter the frequency of days for displaying data: "))
filename = input("Please enter filename to store results: ")
print("Simulation Finished - resultdata written to", filename)
values=[]
with open('initvals.txt','r') as f:
for line in f:
values.append(list(map(float,line.split())))
RABBIT_BIRTH_RATE = ?这里填啥?
FOX_BIRTH_RATE