TECHNOLOGIES:

# Python - Print a Fibonacci Series

Article:
Viewed:  1754
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.

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) Comment:
{"ft_lang_label":"__label__en","ft_lang_prob":0.5933871,"math_prob":0.5685221,"size":530,"snap":"2022-40-2023-06","text_gpt3_token_len":162,"char_repetition_ratio":0.14258555,"word_repetition_ratio":0.0,"special_character_ratio":0.31886792,"punctuation_ratio":0.168,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99690294,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-04T02:25:34Z\",\"WARC-Record-ID\":\"<urn:uuid:579332fa-5cc3-4ae0-846b-edd515fc8d7d>\",\"Content-Length\":\"47273\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9bb530e0-7b13-4d59-a77b-b983065e4070>\",\"WARC-Concurrent-To\":\"<urn:uuid:0dbda334-1957-497a-ba7c-d0e3d32a20c8>\",\"WARC-IP-Address\":\"217.160.0.85\",\"WARC-Target-URI\":\"http://dotnetcodesg.com/Article/UploadFile/1/14428/Python%20-%20Print%20a%20Fibonacci%20Series.aspx\",\"WARC-Payload-Digest\":\"sha1:VGZGU2LD3LQ5FPUAXOJN2VYTJ5AV3CIP\",\"WARC-Block-Digest\":\"sha1:JSFVNTMYJFKPWB2FQETJKJOXYEUFZJXS\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500080.82_warc_CC-MAIN-20230204012622-20230204042622-00312.warc.gz\"}"}