Once we are given the first poem to work with, every single time I move to the next step, it moves the poem to after the function. I need to manually move it back up to the top before the function that calls it.
Does the code work fine as it’s given to you?
I think so. But if code processes in strict order, it doesn’t make sense to me that the poems can be defined after the function that calls them.
Does the function definition rely upon the poem to be defined first?
I thought it did.
Sounds like it doesn’t? I’m confused.
I’d try tracing the logic in the order that the lines are executed. The order of execution is what matters in this case.
1 Like
OH! It took this old brain a hot minute, but it makes sense now. It’s not about when the function is defined, relative to defining the poems, it’s about when the function is CALLED. As long as the poems are defined before the function is CALLED, it’s all good.
1 Like