Question: Problem 1 . 3 ( 1 0 pts ) The Fibonacci numbers are a sequence of integers in which the first two elements are 1

Problem 1.3(10 pts) The Fibonacci numbers are a sequence of integers in which the first two elements are 1, and
each following element is the sum of the two preceding elements. The mathematical definition of each kth Fibonacci
number is the following:
()={(1)+(2),>2
1,<=2
For example, the first 12 Fibonacci numbers are 1,1,2,3,5,8,13,21,34,55,89 and 144. Write the Python code
to implement the function fib_nums that takes one integer, k, and displays the first kth Fibonacci numbers.
Examples:
>>> fib_nums(5)
1
1
2
3
5
>>> fib_nums(8)
1
1
2
3
5
8
13
21

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!