CJCoding With Joseph
15free / daySign inCreate account

Ask Until Yes Or No

Ask Continue? (y/n) and keep asking, printing Please answer y or n. each time, until the stripped and lower-cased answer (.lower()) is one of y, yes, n or no. Then print Continuing. for a yes and Stopped. for a no. Input: one answer per line; the last line is a valid answer. The prompt is part of the output, so each message follows a prompt on the same line.

Expected Output:

Continue? (y/n) Please answer y or n.
Continue? (y/n) Continuing.

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Menus & Validation
📥 Auto-Input:
maybe\nYes\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.