SELECTION (continued)
The following code snippet shows you how converting from pseudocode to the Python programming language would look.

Example2.py

age = int(input('Enter your age: '))
if age >= 18:
   print('You can join the Army')
else:
   print('You're not old enough yet')

Another Selection programming construct you may come across, depending on the computer language you choose to code, is the CASE statement. Look at the following example.

SELECT TAXRATE
CASE TAXRATE IS LOW
   PRINT "You Pay 15% of your salary to tax"
CASE TAXRATE IS MEDIUM
   PRINT "You pay 30% of your salary to tax"
CASE TAXRATE IS HIGH
   PRINT "You pay 45% of your salary to tax"
DEFAULT
   PRINT "You pay zero tax"

Again, we are using a variable to test a condition. In this case the variable is TAXRATE. I'm sure you can figure out what this program fragment would do. It simply looks at the TAXRATE variable, and depending on the variable's value, it prints out what the matching tax on your pay would be. Note there is a DEFAULT condition, in case the TAXRATE variable is not set, or for some reason does not match the available values.