Dinosaur assignment - model function

Hello
I am struggling with the instructions to the model() function in the Dinosaur assignment, specifically this:

The prompt in the code is this:

** # Set the index idx (see instructions above)**
** idx = None**

The instructions:

Set the index idx into the list of examples
  • Using the for-loop, walk through the shuffled list of dinosaur names in the list “examples.”
  • For example, if there are n_e examples, and the for-loop increments the index to n_e onwards, think of how you would make the index cycle back to 0, so that you can continue feeding the examples into the model when j is n_e, n_e + 1, etc.
  • Hint: (n_e + 1) % n_e equals 1, which is otherwise the ‘remainder’ you get when you divide (n_e + 1) by n_e.
  • % is the modulo operator in python.

I am very confused: the code prompt implies “idx = …” is just one line of code (like it’s in every exercise so far), but the instructions suggest there needs to be a loop over every example in the examples list? The rest of the instructions are also confusing - not sure what to make of it.
thank you

Those instructions are quite confusing. They describe the code you need in way more detail than necessary. You do not need to add a for-loop.

Only the last two bullets apply to the line of code you write, combined with the observation that you want to cycle through all of the elements in the “examples” list. ‘idx’ is the index value into that list. You will need to know the length of the “examples” list.