Ad
Mathematics
Algorithms
Logic
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)))