Back
Close

Énigme un couple de lapins (Enigma rabbit's couples)

Fatavis
5,044 views

Bienvenue

Version française

Un homme met un couple de lapins dans un lieu isolé de tous les côtés par un mur. Combien de couples obtient-on en deux ans si chaque couple engendre tous les mois un nouveau couple à compter de la fin du second mois de son existence ?

Pour répondre, vous pouvez écrire un programme en python. Vous êtes libre d'utiliser toutes les structures qui vous paraissent intéressantes (par exemple les conditions ou boucles). Cependant pour valider votre réponse, à la fin vous devez afficher votre résulat sous la forme d'un entier

réponse = 5

print(réponse)

N'hésitez pas à lire l'énigme ici : https://irobotechart.com/enigme-avec-des-lapins.html

Voici un exemple sous la forme d'une image (elle provient de Wikipédia : https://fr.wikipedia.org/wiki/Fichier:FibonacciRabbit.svg) Image exemple de la situation avec des lapins

Les informations sur l'auteur de l'image sont les suivantes : Ein_Hase_mit_blauem_Ei.svg: MichaelFrey & Sundance Raphael

English Version

Suppose a newly-born pair of rabbits, one male, one female, are put in a field. Rabbits are able to mate at the age of one month so that at the end of its second month a female can produce another pair of rabbits. Suppose that our rabbits never die and that the female always produces one new pair (one male, one female) every month from the second month on.

How many pairs will there be in two year?

In order to answer, you can write a program in python. You are free to use all of the structures that you think interesting (for instance the loops). However to check yoour answer, at the end you must print your results in the form of integer :

answer = 5

print(answer

Don't hesitate to read the enigma on : https://irobotechart.com/enigme-avec-des-lapins.html

Here an image (available on Wikipedia : https://fr.wikipedia.org/wiki/Fichier:FibonacciRabbit.svg) in order to illustrate the enigma Image which illustrates the enigma with the rabbits

The information on the author are the following : Ein_Hase_mit_blauem_Ei.svg: MichaelFrey & Sundance Raphael

Enigme(Enigma)

Enigme
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io