Horje
fibonacci in list python Code Example
fibonacci in list python
#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
Stickler Thief or Maximum sum such that no two elements are adjacent Code Example Stickler Thief or Maximum sum such that no two elements are adjacent Code Example
enumerate() Code Example enumerate() Code Example
reportlab drawimage issues with png transparency background Code Example reportlab drawimage issues with png transparency background Code Example
Nlog as a library to use in different project Code Example Nlog as a library to use in different project Code Example
pandas take entries from other column if column is nan Code Example pandas take entries from other column if column is nan Code Example

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