Email: Password:       Forgot Password 
    .netCodeSG
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
 
TECHNOLOGIES:
 

Python - Print a Fibonacci Series

Article:
Viewed:  728 
Posted On:  23/05/2015 08:00:06 
In this article I am going to explain how we can print the fibonacci series....till 50 terms in Python 

 

Here in this article I am going to show how we can print a Fibonacci series in Python.

Follow below Steps:

Step 1: Open IDLE(Python GUI) in your system.

Step 2 : Type the below code and save the code Eg:- I have saved with Fibonacci name.

b = 0
c = 1

print("fibonacci series for 50 terms")

print("",b)
print("",c)

for a in range(1,50):
    d = b+c
    b = c
    c = d
    print("",d)
 
print("end")

 
 
Step 3 : Open command prompt.

Step 4 : Go to the saved script folder.

Step 5 : Write python <Script name>.py  for execution.(Eg.- python fibonacci.py)

1.png

  Comment:
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us