QUESTION IMAGE
Question
your python program has this code.
for n = 1 to 10:
position = position + 10 # move the position 10 steps.
direction = direction + 90 # change the direction by 90 degrees.
you decided to write your program in a block programming language.
what is the first block you need in your program?
repeat forever
repeat 10 times
stop
wait 10 seconds
The Python code has a for n = 1 to 10 loop. In block - programming languages, a loop that runs a specific number of times (here 10 times) is represented by a repeat [number of times] block. The repeat forever block would create an infinite loop which is not the case here. The stop block is used to halt the program and has no relation to the loop structure. The wait 10 seconds block is for pausing the program execution for a time duration and not for looping.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
repeat 10 times