Python Tutorial 5 (Fibonacci Series)

preview_player
Показать описание
Today we covered how to generate the fibonacci series using python.

Рекомендации по теме
Комментарии
Автор

Thanks man, you saved my day. Though I made a little change and made it start from 0, but thanks for this brilliant idea !!!

gamingwithdeku
Автор

a=0
b=1
While b<10:
Print(b)
a=b
b=a+b


Output
1
2
4
8
Iam getting this output if any error in my code

rajj
Автор

i used while True:
and my PC said : Really Dude, Wanna do this ?

abdelwakyl-benterki
Автор

Thank you for explaining this. I'm legit a dumbass for not understanding this while going through that tutorial lol

linksys
Автор

def fibseries(n):
if n <= 1:
return [0]
elif n == 2:
return [0, 1]
series = fibseries(n-1)
first = series[-2]
second = series[-1]
return series + [first+second]
num=int(input("enter the number to limit the number of fibonacci series: "))
print(fibseries(num))

mehmeteminaydn