A program that will ask the user to give an integer number value and then it will generate the corresponding fibonacci number using Python as my programming language.
My mobile number here in the Philippines is 09173084360.
If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
def fibonacci_sequence(values):
if values <= 1:
return values
else:
return(fibonacci_sequence(values-1) + fibonacci_sequence(values-2))
print("-" * 30)
print(" FIBONACCI SEQUENCE PROGRAM ")
print("-" * 30)
items = int(input("Enter an Integer Number : "))
if items <= 0:
print("Plese enter a positive integer")
else:
print("The result is :")
for a in range(items):
print(fibonacci_sequence(a))
No comments:
Post a Comment