Loading, please wait... # Program to Display Fibonacci Sequence Using Recursion | Python

Mar 04, 2021 Python, 889 Views
Program to Display Fibonacci Sequence Using Recursion

## Program to Display Fibonacci Sequence Using Recursion

``````def recur_fibo(n):
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))

nterms = 10

if nterms <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci sequence:")
for i in range(nterms):
print(recur_fibo(i))``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.5051604,"math_prob":0.7556499,"size":405,"snap":"2021-21-2021-25","text_gpt3_token_len":111,"char_repetition_ratio":0.14962594,"word_repetition_ratio":0.1764706,"special_character_ratio":0.25185186,"punctuation_ratio":0.10294118,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99590796,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,1,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-17T10:43:06Z\",\"WARC-Record-ID\":\"<urn:uuid:0018bf32-8192-45fc-9cd6-9969c32c6e51>\",\"Content-Length\":\"45644\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7979a5a5-e5db-43e7-a83d-f6fb038eabe9>\",\"WARC-Concurrent-To\":\"<urn:uuid:797b89e3-6c03-4434-96b9-f2befd5e3d8a>\",\"WARC-IP-Address\":\"104.211.97.138\",\"WARC-Target-URI\":\"https://tutorialslink.com/Articles/Program-to-Display-Fibonacci-Sequence-Using-Recursion-Python/2413\",\"WARC-Payload-Digest\":\"sha1:ZIJHXREAXWLOFXO23ISDSXIDEDZCWGFQ\",\"WARC-Block-Digest\":\"sha1:CTGJTV5EUI3B5E2NXYMQ6H7TR4JVEKQA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243992159.64_warc_CC-MAIN-20210517084550-20210517114550-00445.warc.gz\"}"}