What do you want to save?
Add Code snippet
New code examples
-
Python 2021-08-28 04:51:01
fibonacci series print
# Program to display the Fibonacci sequence up to n-th term nterms = int(input("How many terms? ")) # first two terms n1, n2 = 0, 1 count = 0 # check if the number of terms is valid if nterms <= 0: print("Please enter a positive in... Add solution -
Python 2021-08-27 18:01:01
fibonacci series for loop python
# WARNING: this program assumes the # fibonacci sequence starts at 1 def fib(num): """return the number at index `num` in the fibonacci sequence""" if num <= 2: return 1 return fib(num - 1) + fib(num - 2) ... Add solution