2. Exercise 1
Exercise 1
Below is a description of a fictional bureaucratic process:
To qualify for benefits, you have to be at least 18 years old and be either a citizen or a permanent resident. People who earn more than 50,000 dollars a year are not eligible, people who earn between 20,000 and 50,000 dollars a year are eligible for healthcare allowance only, and people who earn less than 20,000 dollars a year are eligible for healthcare allowance and food stamps.
Which of the following conditional blocks represents it correctly? (If you find it hard to follow the conditionals, you can always draw a decision tree or try running the code!)
A
status = "Not eligible"
if age >= 18:
if citizen or resident:
if income <= 50000:
if income < 20000:
status = "Healthcare allowance and food stamps"
else:
status = "Healthcare allowance"