how do you make an application that will calculate a fabonac
how do you make an application that will calculate a fabonacci number with a given input. Give the user the choice of 25, 50, 75, 100 runs
Solution
def fibonacci(n):
\"\"\"Recursive function to
print Fibonacci sequence\"\"\"
if n <= 1:
return n
else:
return(fibonacci(n-1) + fibonacci(n-2))
choice = input(\"Enter number among 25, 50, 75, 100 to find fibonacci: \")
if choice==25 or choice==50 or choice==75 or choice==100:
print fibonacci(choice)
else:
print \"Invalid input.\"
