Program to get the Fibonacci series between 0 to 50.

In this python basic program, we will get the Fibonacci series between 0 to 50 numbers.

Steps to solve the program
  1. Create two variables and assign their values equal to 0 and 1 respectively.
  2. Create another variable count and assign its value equal to 0.
  3. While the count variable is less than 50 print the num1.
  4. Add num1 and num2 and assign their addition to the n2 variable.
  5. Change the value of num1 with num2 and num2 with n2.
  6. Add 1 to the count variable.
  7. Print the Fibonacci series.
				
					num1 = 0
num2 = 1
count = 0

print("Sequence is: ",end=" ")
while count<50:
    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 89 144 233 377 610 
987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 
196418 317811 514229 832040 1346269 2178309 3524578 5702887
9227465 14930352 24157817 39088169 63245986 102334155 165580141 
267914296 433494437 701408733 1134903170 1836311903 2971215073 
4807526976 7778742049 
				
			

reverse a given number.

check given number is palindrome or not.

Leave a Comment