About 940,000 results
Open links in new tab
  1. Python Program to Print the Fibonacci sequence

    If the number of terms is more than 2, we use a while loop to find the next term in the sequence by adding the preceding two terms. We then interchange the variables (update it) and continue on with the process.

  2. Print the Fibonacci sequence - Python - GeeksforGeeks

    Mar 22, 2025 · This approach uses a while loop to print the first n Fibonacci numbers by repeatedly summing the previous two numbers. It starts with 0 and 1, and calculates the next number in the sequence until n terms are printed.

  3. Fibonacci Series Program In Python

    Aug 27, 2024 · Learn how to generate the Fibonacci series in Python using various methods, including for loops, while loops, and functions with examples.

  4. Fibonacci Series in Python using While Loop - StackHowTo

    Jun 25, 2021 · Fibonacci sequence is a sequence of integers of 0, 1, 2, 3, 5, 8… The first two terms are 0 and 1. All the other terms are obtained by adding the two previous terms. This means that the nth term is the sum of the (n-1)th and (n-2)th term. This example will print the Fibonacci sequence of 10.

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

    May 8, 2013 · This way is efficient enough, but your code can do better n = int(input("Enter a number: ")) a = b = 1 while(b <= n): print(b, end = " ") a, b = b, a + b

  6. Python Fibonacci Series Program - Tutorial Gateway

    This blog post will show how to write a Python program to generate the Fibonacci Series of numbers using While Loop, For Loop, and Recursion. We will also explore finding the sum using loops.

  7. Python Generate Fibonacci Series [4 Ways] – PYnative

    Mar 27, 2025 · The best method for generating the Fibonacci series in Python depends on the specific requirements: For a small number of terms: The simple iterative approach using a for or while loop is usually the most straightforward and efficient.

  8. Fibonacci Series in Python: Program to Print Easily

    Python offers multiple ways to generate Fibonacci numbers, and in this article, we’ll explore two methods to print the Fibonacci series: using a while loop and recursion.

  9. Python Program To Print Fibonacci Series Using A Loop

    In this tutorial, you will learn to write a Python program to print the Fibonacci series using a loop. The Fibonacci series is a sequence of numbers in which each number is the sum of the two preceding numbers. The first two numbers in the series are 0 and 1, and the rest of the series is generated by adding the previous two numbers.

  10. Python Program to Print Fibonacci Numbers using While Loop

    In this tutorial, we are going to print Fibonacci numbers until a given number by using a while loop in Python. This program generates all the Fibonacci numbers up to a given number n using a while loop. print(a) a = b. b = a + b. # Print the current Fibonacci number. print(a) # Update a and b to generate the next Fibonacci number. a = b. b = a + b

Refresh