Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

your python program has this code. for n = 1 to 10: position = position…

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

Explanation:

Brief Explanations

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.

Answer:

repeat 10 times