← Back to Menus & Validation
Question 443
Yes Or No Confirmation
Yes Or No Confirmation
Ask Delete everything? (y/n) and read one line. Treat y or yes in any mix of upper and lower case (use .lower() on the stripped answer) as a confirmation: print Deleted. for a confirmation and Kept. for anything else. Input: one line. The prompt is part of the output, so the result follows it on the same line.
Expected Output:
Delete everything? (y/n) Deleted.= 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.