Dark theme

Hints


The algorithm is:

  1. Make a number_of_rabbits variable and set it = 2.
  2. Print out the number in this generation.
  3. Make a loop that runs from two up to and including 20. Note that we're not starting at zero.
  4. In the loop, do the relevant maths and print the number in the generation.


One answer