Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
DESPERATE for help with Python for beginners (10 points for best answer!)?
I am taking a beginners class on Python, and have no clue how to do this problem. I have tried many times, but can't seem to get it. If you could write the code out so I can understand it, that would be awesome. Here is the question:
1. You are given a arbitrary numerical sequence that has the form 0, 1, 1, 3, 5, 11, 21,.... Each successive number, after the first two, is found by adding the number before it with two times the number two slots before it. For example, the 5th number in the sequence is (3)+day (1*2)=5 and the sixth number is (5)+(3*2)=11. Your goal is to write a loop that computes 30 terms in the sequence. Store this sequence as a list and then print the list. You should get the following output:
[0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, 5461, 10923, 21845, 43691, 87381, 174763, 349525, 699051, 1398101, 2796203, 5592405, 11184811, 22369621, 44739243, 89478485, 178956971]
The second question is:
Once you have you list of this sequence of numbers, use this list to calculate a new list of the ratios the current number in the list divided by the next number in the list. In other words, each number in the ratio list will be the number in your original list divided by the next number in your original list. Print the values of your ratio list.
Thanks so much for the help!
Be the first to answer this question.