Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Are repeat loops and while do's the same thing?(Example included)

Asked by 8 years ago

Are repeat loops and while do's the same thing?

example:

while pod < 5 do print ("Thank you") pod = pod + 1

end

and

pod = 4

repeat print(pod) pod = pod + 1 until pod > 10

are they the same thing or no? Please explain your answer

1 answer

Log in to vote
0
Answered by 8 years ago

The difference between a while loop and a repeat loop is that a while won't run a code at all if a condition is true, whereas repeat will run the code at least once before checking the condition.

Ad

Answer this question