← Back to Menus & Validation
Question 457
Insist On A Name
Insist On A Name
Ask Name: and keep asking, printing A name is required. each time, until the stripped answer is not empty (a line of spaces counts as empty because of .strip()). Then print Welcome, <name>!. Input: one answer per line; the last line holds a name. The prompt is part of the output, so each message follows a prompt on the same line.
Expected Output:
Name: A name is required. Name: A name is required. Name: Welcome, Maya!
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Menus & Validation
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.