Question: Python Programing 1. Multiplying Rabbits (10 points): Suppose that at the beginning of the month, you are gifted with a pair of baby rabbits, one

Python Programing

Python Programing 1. Multiplying Rabbits (10 points): Suppose that at the beginning

1. Multiplying Rabbits (10 points): Suppose that at the beginning of the month, you are gifted with a pair of baby rabbits, one male and one female. All rabbits mature in exactly one month, and start reproducing with their pair from the second month onwards. Suppose also that when they reproduce, the female rabbits always give birth to another pair of male and female baby rabbits. So at the beginning of the first month, there is one pair of rabbits. Then they mature, and so there are still one pair at the beginning of the second month. But at the beginning of the third month there are two pairs (one adult pair and a baby pair). At the beginning of the fourth month, there are three pairs (two adult pairs and one baby pair), and so on. Given the total number of months n (accepted from user input), please print the total number of rabbits that exist at the beginning of the nth month. A sample input and output is shown below. Sample Input and Output: Enter total months: 10 There will be 89 pairs of rabbits. Since the output can get very large, the program will be tested for only small values of the input, up to 100 months. Please name your program multiplying-rabbits.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!