Get the Fibonacci series between 0 to 10

In this program, we will get the Fibonacci series between 0 to 10.

Steps to solve the program
  1. Create two variables num1, and num2 and assign their values equal to 0 and 1.
  2. Create a count variable and assign its values equal to 0.
  3. While the count variable is less than 10 print num1.
  4. Add num1 and num2 and store the result in a new variable n2.
  5. Change num1 to num2 and num2 to n2 and add 1 to the count variable.
  6. Print the output.
				
					count = 0
num1,num2 = 0,1
print("Sequence is: ",end=" ")

while count < 11:
    print(num1,end=" ")
    n2 = num1 + num2
    num1 = num2
    num2 = n2
    count += 1
				
			

Output :

				
					Sequence is:  0 1 1 2 3 5 8 13 21 34 55 
				
			

construct the following pattern

check the validity of password

Leave a Comment