Question about until loop


I’m a bit confused about the until loop. The explanation said that the until loop will run until a truthy condition is met.

until false

How come in the above block, the loop does not end even though truthy statements are being evaluated. What is the reason for the loop continuing. Is it because the “until” loop only ends when the condition == true? And since false will always be false, then a truthy condition is never met?

I’m probably overthinking this.


Hi Ryan,

This is similar to the other question you posted. Basically, what is going on is exactly like how you put it in your last statement. False will always be false; it does not matter if there is a truthy statement in the until block. If you do want the “true” to end the until block, you will need to save it in a Boolean variable and have that be your conditional.

Michael Ruan

Thank you,

I was definitely overthinking it!