In this exercise, you’re going to finish coding a program that calculates how many years the user will have to wait until they can vote in Australia. The voting age in Australia is 18.
In the editor below, fill in the blanks (
________) so that the program asks for the
age of the user, works out how many years until they can vote, and
years_remaining = 18 - age
Remember to use the Python reference sheet to help you with your code! Click on one of the buttons below:
Need some help? Click here to reveal a video walkthrough for this task!
ageto an integer.
ageand the legal voting age (18 in Australia) and
agewill not be an integer by default, you will need to use the
int()command to convert it!
Below is an example of how the program should run:
Please enter your name: Alice Please enter your age: 14 Hi Alice! You have... 4 year(s) remaining before you can vote in Australia!