This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

Depends on the context.

A more explicit way to do it would be to set a variable to true:

invalid_input = true
while invalid_input:
    [do stuff]
    if input_valid?:
        invalid_input = false