Population growth

Define a function population_growth that receives an initial population,
annual rate of growth, and target population. Use a while loop to calculate
how many years it takes to go over the target population and return it. If
the annual growth rate is not greater than zero, return 'invalid growth rate'.
Do not use math.pow or the x**y operator.

Target = Initial * (1 +rate)^(number of years)

Examples:

>>> population_growth(5000, 0.1, 10000)
8
>>> population_growth(5000, 0.1, 20000)
15
>>> population_growth(5000, 0.1, 40000)
22
>>> population_growth(5000, 0, 40000)
'invalid growth rate'
import unittest


class PopulationGrowthTestCase(unittest.TestCase):

    def test_population_X2(self):
        self.assertEqual(population_growth(5000, 0.1, 10000), 8)

    def test_population_X4(self):
        self.assertEqual(population_growth(5000, 0.1, 20000), 15)

    def test_population_X8(self):
        self.assertEqual(population_growth(5000, 0.1, 40000), 22)

    def test_bad_growth_rate(self):
        self.assertEqual(population_growth(5000, 0, 40000), 
            'invalid growth rate')