Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # function
- # credit goes to antiloquax for all the fib scripts
- def fibonacci(number):
- fib = [0, 1]
- for i in range(number):
- fib.append(fib[i] + fib[i + 1])
- return(fib[i])
- print("Fibonacci")
- request = int(input("Which item in the series?"))
- print(fibonacci(request))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement