{"id":31990,"date":"2022-11-28T11:23:24","date_gmt":"2022-11-28T11:23:24","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=31990"},"modified":"2022-12-23T05:45:02","modified_gmt":"2022-12-23T05:45:02","slug":"python-example-code-program-to-display-the-fibonacci-sequence-up-to-n-th-termpython-example-code","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/python-example-code-program-to-display-the-fibonacci-sequence-up-to-n-th-termpython-example-code\/","title":{"rendered":"Python Example Code: Program to display the Fibonacci sequence up to n-th termPython Example Code:"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">What is the Fibonacci sequence?<\/h3>\n\n\n\n<p>The Fibonacci sequence is a set of integers (the Fibonacci numbers) that starts with a\u00a0zero, followed by a one, then by another one, and then by a series of steadily increasing numbers. The sequence follows the rule that each number is equal to the sum of the preceding two numbers.<\/p>\n\n\n\n<p>The Fibonacci sequence begins with the following 14 integers:<\/p>\n\n\n\n<p>0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 &#8230;<\/p>\n\n\n\n<p>Each number, starting with the third, adheres to the prescribed formula. For example, the seventh number, 8, is preceded by 3 and 5, which add up to 8.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>The first two terms are 0 and 1. All other terms are obtained by adding the preceding two terms. This means to say the nth term is the sum of (n-1)th and (n-2)th term.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/59f05aa95c88c8f4fb19ccdf09ed4d34.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>What is the Fibonacci sequence? The Fibonacci sequence is a set of integers (the Fibonacci numbers) that starts with a\u00a0zero, followed by a one, then by another&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-31990","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=31990"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31990\/revisions"}],"predecessor-version":[{"id":31995,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31990\/revisions\/31995"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=31990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=31990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=31990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}