Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help me to do question 4. Use python! Question 4: Fibonacci Sequence (3 points) The Fibonacci sequence has the form 1, 1,2,3,5,8, Each successive number,
Help me to do question 4. Use python! Question 4: Fibonacci Sequence (3 points) The Fibonacci sequence has the form 1, 1,2,3,5,8, Each successive number, after the first two, is found by adding the previous two numbers in the sequence. For example, the 7th number in the sequence is 5+8 13. A possibly useful hint: We might not have explicitly talked about it in class yet, but one really useful thing that Python allows you to do is index lists using negative numbers, which allows you to move backwards through the list as you increase the size of the negative number, starting with-1. That means that if I have the list stuff- [1,2,3,41,1can do stuff[-1] and I'll get the last number, 4'lf1want the second to last number, I would do stuff!-2]. Your goal is to write a function that computes 100 terms in the sequence. You function should accept a value (n) (the number of terms in the sequence you wish to compute) and return the list containing the first 100 terms of the Filbonacci sequence. Test your function for n #4.5,6,7 to ensure they match up with the sequence above. # write your solution to question 4 in this cell # Define your function here # Call your functidh here
Help me to do question 4. Use python!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started