population_growth.nbt 227 B

123456
  1. let initial_population = 50_000 people
  2. let growth_rate: Rate = 2 percent per year
  3. fn predict_population(time: Time) = initial_population × e^(growth_rate time) // round
  4. assert_eq(predict_population(10 years), 61_070 person)