I am trying to write a function that calculates the number of days a species of bacteria takes for its initial population to reach its final population given that each day its population doubles. My code is;

```
def num_doublings(initial_population, final_population):
   time = 0
   while initial_population < final_population:
       time+= 1
       initial_population = initial_population * 2
       print(time)

```

This prints each day, but I want it to only print the total number of iterations it takes for the while loop to stop. The output of my code when the function is called with `num_doublings(2, 8)` is

```
1
2
3

```

but I only need it to output 3. How do I fix this ?