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

    Mar 8, 2013 · I'm just trying to improve my programming skill by making some basic functions. I want to fill a list with fibonacci values, but I think my code gives the sum of all the numbers put together and p...

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

    Apr 12, 2020 · I know there is nothing wrong with writing with proper function structure, but I would like to know how can I find nth fibonacci number with most Pythonic way with a one-line. I wrote that code, b...

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

    Feb 18, 2014 · This code puts the first 700 fibonacci numbers in a list. Using meaningful variable names helps improve readability! fibonacci_numbers = [0, 1] for i in range(2,700): fibonacci_numbers.append(fibonacci_numbers[i-1]+fibonacci_numbers[i-2]) Note: If you're using Python < 3, use xrange instead of range.

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

    Apr 5, 2013 · I'm thinking I could use separate functions but I can't figure out how to pass the argument that calculates the fibonacci sequence. Then the next step would be to to print out the sequence of numbers up to that number.

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

    For instance, the code below detects the first Fibonacci number after 1 that is a square using a while loop over list comprehensions: #find the lowest square above 1 in the fibonacci sequence

  6. Python Fibonacci Generator - Stack Overflow

    Python is a dynamically typed language. the type of a variable is determined at runtime and it can vary as the execution is in progress. Here at first, you have declared a to hold an integer type and later you have assigned a function to it and so its type now became a function.

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

    Aug 11, 2013 · To find the sum of the first n even-valued fibonacci numbers directly, put 3n + 2 in your favourite method to efficiently compute a single fibonacci number, decrement by one and divide by two (fib((3*n+2) - 1)/2)).

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

    May 8, 2013 · 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.

  9. python - Trying to write a code that will find the sum of the even ...

    Nov 13, 2017 · I'm new to programming and I'm trying to write a program in Python that will find the sum of the even numbers of the numbers below 4,000,000 in the Fibonacci sequence.

  10. Creating fibonacci sequence generator (Beginner Python)

    Jan 21, 2012 · Hi I'm trying to create a Fibonacci sequence generator in Python. This is my code: d =raw_input("How many numbers would you like to display") a = 1 b = 1 print a print b for d in range(d): ...

Refresh