16 lines
496 B
Python
16 lines
496 B
Python
def fibitts(s_population: list, months: int, previous = None):
|
|
#every 2 months: 1 pair -> 2 pairs
|
|
#newborn pair can produce a new pair only after 2 months
|
|
|
|
if previous is None:
|
|
previous = s_population[0]
|
|
|
|
for month in range(months+1):
|
|
if month == 0:
|
|
pass
|
|
else:
|
|
s_population.append(s_population[month]+previous)
|
|
print(f"Month {month}: {s_population[month]}")
|
|
previous = s_population[month]
|
|
|
|
fibitts([1,1], 24) |