这是我的代码
def time_to_end_of_world(p_spread,p_cure):
...: my_world=set_up_cities()
...: zombify(my_world,0)
...: count=0
...: while is_end_of_world(my_world)==False:
...: sim_step(my_world,p_spread,p_cure)
...: count+=1
...: return count
我不断得到 1 作为我的出局
如果我将返回计数移出像这样的缩进
def time_to_end_of_world(p_spread,p_cure):
...: my_world=set_up_cities()
...: zombify(my_world,0)
...: count=0
...: while is_end_of_world(my_world)==False:
...: sim_step(my_world,p_spread,p_cure)
...: count+=1
...: return count
程序崩溃...
有任何想法吗?