← Back to If Statements
Question 209
Password Gate
Password Gate
Ask for a password with the prompt Password: (one space after the colon) and compare it with the secret open sesame: a match prints Access granted, anything else prints Access denied. Input: one line, the password typed. The prompt is part of the output and stays on the same line as the verdict, as shown in Expected Output. Compare the strings with ==.
Expected Output:
Password: Access granted= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
If Statements
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.