← Back to If Statements
Question 204
Voting Age Check
Voting Age Check
Ask for an age with the prompt How old are you? (one space after the question mark) and decide whether the person may vote: at 18 or older print You can vote, otherwise print Not yet. Input: one line, the age as an integer. The prompt is part of the output and input() does not move to a new line, so the verdict follows the prompt on the same line, as shown in Expected Output.
Expected Output:
How old are you? You can vote= 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.