You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution for Practice 19.2 requires the use of the "size" variable, but nowhere in the lesson, practice instructions, or hints is the "size" variable mentioned. This means that the user has to guess the variable to search for in the "rectangle_sizes" array.
I had the formula (almost) correct from the start, but because I had no idea what the appropriate variable's identifier was, I thought I got the syntax completely wrong and tried everything under the sun to fix it. Instead, I was supposed to guess that "size" was the appropriate identifier instead of "rectangle" or (as had been used in previous lessons) "number."
For example, I would type:
func run()
for rectangle in rectangle_sizes:
draw_rectangle(rectangle.x, rectangle.y)
jump (300, 0)
or:
func run()
for number in rectangle_sizes:
draw_rectangle(number.x, number.y)
jump (300, 0)
and because neither of those worked, and I had no idea what the correct variable to use was, I messed with the syntax until I just gave up and checked the solution.
The text was updated successfully, but these errors were encountered:
It's not required to name the for loop variable size or something specific. Perhaps your code had another difference, like different indentation causing the logic to be different? Using both the code listings you provided with the two function calls as part of the for loop solves the practice. Here's a screenshot of the first case:
The solution for Practice 19.2 requires the use of the "size" variable, but nowhere in the lesson, practice instructions, or hints is the "size" variable mentioned. This means that the user has to guess the variable to search for in the "rectangle_sizes" array.
I had the formula (almost) correct from the start, but because I had no idea what the appropriate variable's identifier was, I thought I got the syntax completely wrong and tried everything under the sun to fix it. Instead, I was supposed to guess that "size" was the appropriate identifier instead of "rectangle" or (as had been used in previous lessons) "number."
For example, I would type:
or:
and because neither of those worked, and I had no idea what the correct variable to use was, I messed with the syntax until I just gave up and checked the solution.
The text was updated successfully, but these errors were encountered: