Reference no: EM133059354
Learning Activity: Programming Exercise - Fibonacci series
In mathematics, Fibonacci numbers form a sequence such that each number is the sum of the two preceding ones, starting from 0 and 1. The first few terms of Fibonacci sequence is:
0,1,1,2,3,5,8,13,21,34,55,89,144...
The third term (1) is the sum of the preceding two terms (0+1). The fourth term (2) is the sum of the preceding two terms (1+1). The fifth term (3) is the sum of the preceding two terms (1+2) and so on.
Now write a Python program that allows the user to type in an integer n. Your program will then output the first n terms in Fibonacci series, separated by comma.
Sample input/output 1:
>>> Enter a positive integer
>>> 5
>>> 0,1,1,2,3
Sample input/output 2:
>>> Enter a positive integer
>>> 8
>>> 0,1,1,2,3,5,8,13
This learning activity asks you to write a program.