Horje
fibonacci sequence python genorator Code Example
fibonacci sequence python genorator
#Learnprogramo
Number = int(input("How many terms? "))
# first two terms
First_Value, Second_Value = 0, 1
i = 0
if Number <= 0:
print("Please enter a positive integer")
elif Number == 1:
print("Fibonacci sequence upto",Number,":")
print(First_Value)
else:
print("Fibonacci sequence:")
while i < Number:
print(First_Value)
Next = First_Value + Second_Value
# update values
First_Value = Second_Value
Second_Value = Next
i += 1




Python

Related
can the function inside a function be global if the function before it is global Code Example can the function inside a function be global if the function before it is global Code Example
load local data to django Code Example load local data to django Code Example
convert 2d aray into 1d using python Code Example convert 2d aray into 1d using python Code Example
programe to find contagious sum of sequence Code Example programe to find contagious sum of sequence Code Example
getting player input python Code Example getting player input python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7