On the rental market
You are looking to move and have defined variables containing your requirements/limits for number of bedrooms, minimum square feet (area), and maximum rent:
min_num_beds = 2
min_sq_foot = 750
max_rent = 1900
You've seen a property you are interested in and have stored its information in the variables num_beds
, sq_foot
, and rent
. You will build a custom workflow to check if this potential property suits your needs.
This exercise is part of the course
Introduction to Python for Developers
Exercise instructions
- Check if
num_beds
is less thanmin_num_beds
, printing"Insufficient bedrooms"
if this is the case. - Else, check if
sq_foot
is less than or equal tomin_sq_foot
, printing"Too small"
if this is the case. - Else, check if
rent
is more thanmax_rent
, printing"Too expensive"
if this is the case. - Otherwise, print
"This looks promising!"
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Check the number of beds
_____ _____ _____ _____:
____("____")
# Check square feet
# Check the rent
# If all conditions met