CJCoding With Joseph
15free / daySign inCreate account

Hello Or Quit

Show a two-line menu, 1) Say hello and 2) Quit, then read the choice with the prompt Choice: and strip the spaces around it. Choice 1 prints Hello there!, choice 2 prints Goodbye! and leaves the loop, and any other text prints Unknown choice - try again. before the menu is shown again. Input: one choice per line; the last line is always 2. The prompt is part of the output and input() does not end the line, so whatever the program prints next follows Choice: on the same line, as in Expected Output.

Expected Output:

1) Say hello
2) Quit
Choice: Hello there!
1) Say hello
2) Quit
Choice: Goodbye!

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

Hints3 available
Topics:
Menus & Validation
📥 Auto-Input:
1\n2\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.