Show Hide all comments. Using Static Method. The Fibonacci sequence is a series of numbers where a number is the sum of previous two numbers. In this tutorial I will show you how to generate the Fibonacci sequence in Python using a few methods. Working: First the computer reads the value of number of terms for the Fibonacci series from the user. All other terms are obtained by adding the preceding two terms. While learning i am 100% sure that everybody might have done this Fibonacci series in different programming language. The Fibonacci Sequence can be generated using either an iterative or recursive approach. I think what I want to do is just use the while loop for the Fibonacci sequence to create an array using those given values. Fibonacci Series of 10 numbers:0 1 1 2 3 5 8 13 21 34 The only difference in the program logic is use of WHILE Loop to print Fibonacci Numbers Fibonacci Series Based On The User Input //fibonacci series based on the user input The primary difference that we have used the while loop instead of for loop. Two consecutive numbers in this series are in a ' Golden Ratio '. Note: To compute a Fibonacci number at a certain position N, we have to loop through all previous numbers starting at position 0. Updated December 31, 2015. Related: Fibonacci Series in C using For Loop. Generate Fibonacci series using while loop in python - YouTube The length of the sequence is 0 or less than zero. The beginning of the sequence is thus: It means if you wish to know the value at the index X, then it would be the sum of values at the (X-1) and (X-2) positions. nNum = 10 num = 0 num1 = 0 num2 = 1 count = 0 while (count