About 149,000 results
Open links in new tab
  1. Python: Fibonacci Sequence - Stack Overflow

    Mar 8, 2013 · Here is how I would solve the problem. I would define a function to calculate the n th ter om of the fibonacci sequence as follows. def fibo(n): if n<=2: return 1 else: res = fibo(n-1) + …

  2. Fibonacci sequence using list in PYTHON? - Stack Overflow

    Feb 18, 2014 · I have a problem about making a fibonacci sequence to a list, I'm just new to python someone help me please. This is my code. I know this is looking wrong or something …

  3. Python Fibonacci Generator - Stack Overflow

    I need to make a program that asks for the amount of Fibonacci numbers printed and then prints them like 0, 1, 1, 2... but I can't get it to work. My code looks the following: a = int(raw_input('Give

  4. How do I print a fibonacci sequence to the nth number in Python?

    Apr 5, 2013 · Non-recursive solution. def fib(n): cur = 1 old = 1 i = 1 while (i < n): cur, old, i = cur+old, cur, i+1 return cur for i in range(10): print(fib(i))

  5. python - An iterative algorithm for Fibonacci numbers - Stack …

    Feb 24, 2013 · This is a Python question and that’s not Python code. Consider creating a new question, or ask on codereview.SE for review of your code. That being said, your array size is …

  6. Fibonacci numbers, with an one-liner in Python 3?

    This is a closed expression for the Fibonacci series that uses integer arithmetic, and is quite efficient. fib = lambda n:pow(2<<n,n+1,(4<<2*n)-(2<<n)-1)%(2<<n ...

  7. python - Efficient calculation of Fibonacci series - Stack Overflow

    Aug 11, 2013 · I'm working on Project Euler problem 2: the one about the sum of the even Fibonacci numbers up to four million. My code: def Fibonacci(n): if n == 0: return 0 elif n == 1: r...

  8. Python : Fibonacci sequence using range(x,y,n) - Stack Overflow

    A close practical example is the Fibonacci sequence. I reasonably searched hard through available python code for this sequence. There were tons, most often too cryptic for my basic …

  9. Print Fibonacci Series using lambda and map or reduce in python

    May 4, 2014 · I want to print Fibonacci Series using lambda() function with map() or reduce() function in Python. Note: I did search on SO, but could only find questions related to Printing …

  10. while loop - Fibonacci Sequence using Python - Stack Overflow

    Jan 26, 2021 · Hello I am trying to write a script that prompts the user for an integer number (n), then prints all the Fibonacci numbers that are less than or equal to the input, in that order. …

Refresh