Ask Question
25 October, 13:15

First create an empty list called numbers. Then initialize a counter i by assigning it to a value of 1. Next write a for-loop that uses fave as the loop variable (i. e., item in the template) and your top ten list as the iterable. The output of your code should look similar to the following (but with your favorite items, not mine). For each pass of the loop, append the counter i to the numbers list and then use augmented assignment as discussed in class to increment the value of the counter by 1.

+3
Answers (1)
  1. 25 October, 13:28
    0
    for (var i = 0; i < foo. length; i++) {

    document. write ('Item: ' + (i + 1) + ' of ' + foo. length + '

    ');

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “First create an empty list called numbers. Then initialize a counter i by assigning it to a value of 1. Next write a for-loop that uses ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers