<In what way does your code behave incorrectly? Include ALL error messages.>
This exercise has confused me a bit. It asks “then how might we iterate over an array of arrays?” I used the method we had been using for the last few excersies to iterate an array, it worked, but then I read the instructions and apparently they want me to this in a more complicated way. However I do get message “Way to go !”
I don’t quite understand what the course wants me to do. “Call the elements sub_array.”, I wasn’t naming anything here.
s = [[“ham”, “swiss”], [“turkey”, “cheddar”], [“roast beef”, “gruyere”]]
Nesting blocks is fine. Using a sub_array is not necessarily harder. It is easy to read. That is the principal concern. Elegant code is nice, and fun to write. We see the simplicity and like it. However, self-documenting code is usually a little more straight forward and readable, requiring less manual documentation.