import virus
population = 10000
infected = 1
can_catch_virus = population - infected
contacts_per_day = 10
newly_recovered = 0
for day in range(90): # day 從 0 開始,到 89。如果要從 1 開始到 90,就要寫成 range(1,91)。
# Infected chickens spread the virus to those who haven't already had it.
if day > 13: # 因為 day 是從 0 起算,所以 13 代表 day 14。
contacts_per_day = 3
newly_infected = virus.spread(
infected, can_catch_virus, population, contacts_per_day
)
newly_recovered = virus.recover(infected)
infected = infected + newly_infected - newly_recovered
can_catch_virus = can_catch_virus - newly_infected
print(str(infected) + " chickens infected.")
if infected == 0 :
break
print("----------")
print(str(population - can_catch_virus) + " chickens caught the virus.")