I am beginner in python and and i am trying to find fibonacci series of print the first 10 numbers in the Fibonacci series and i am not getting expected output.
Here is code which i have written:
def fibonacci_with_loop(n):
fib_series = [0, 1]
for i in range(2, n):
next_number = fib_series[-1] + fib_series[-2]
fib_series.append(next_number)
print (fib_series)
>Solution :
In order to use the function you wrote, you need to write fibonacci_with_loop() at the end of your code. Could you have forgotten this?