mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
22 lines
501 B
Python
22 lines
501 B
Python
from .__init__ import *
|
|
|
|
|
|
def fibonacciSeriesFunc(minNo=1):
|
|
n = random.randint(minNo, 20)
|
|
|
|
def createFibList(n):
|
|
list = []
|
|
for i in range(n):
|
|
if i < 2:
|
|
list.append(i)
|
|
else:
|
|
val = list[i - 1] + list[i - 2]
|
|
list.append(val)
|
|
return list
|
|
|
|
fibList = createFibList(n)
|
|
|
|
problem = "The Fibonacci Series of the first " + str(n) + " numbers is ?"
|
|
solution = fibList
|
|
return problem, solution
|