The Fibonacci sequence is a series of numbers where each consecutive number is the sum of the previous two.
Write a loop that adds the first 10 values of the Fibonacci sequence to a list.
Display the list.
Hint: You can create your list using the first two numbers in the sequence [0,1]
Output
First ten Fibonacci numbers:
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
Tri-bonacci! This is as it sounds. Create a new list of Tri-bonacci values where each consecutive number is the sum of the previous three numbers
Hint: You can create your list using the first three numbers in the sequence [0,1,1]
Output
First ten Tribonacci numbers:
[0, 1, 1, 2, 4, 7, 13, 24, 44, 81]
Write both the Fibonacci and Tribonacci sequence loops without providing the first two or three starting values.
Allow the user to enter the number of elements to calculate in both the Fibonacci and Tribonacci loops.