Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
Mathematics
Algorithms
Numbers
Fundamentals

Given an integer representing the initial population size i, and the yearly change in the population c (in percentages), return what the population size will be at the end of the nth year.

Example:

The initial population is 1000, and the yearly change is -10%. The population after one year is going to be 900.

Remember to round up your result, as population cannot be floating point number.

import math

def population_tracking(i, c, n):
    return math.ceil(i*((1+(c/100))**(n)))