# Let’s write that program!

`def estimate_house_sales_price(num_of_bedrooms, sqft, neighborhood):  price = 0  # In my area, the average house costs \$200 per sqft  price_per_sqft = 200  if neighborhood == "hipsterton":    # but some areas cost a bit more    price_per_sqft = 400  elif neighborhood == "skid row":    # and some areas cost less    price_per_sqft = 100  # start with a base price estimate based on how big the place is  price = price_per_sqft * sqft  # now adjust our estimate based on the number of bedrooms  if num_of_bedrooms == 0:    # Studio apartments are cheap    price = price — 20000  else:    # places with more bedrooms are usually    # more valuable    price = price + (num_of_bedrooms * 1000) return price`
`def estimate_house_sales_price(num_of_bedrooms, sqft, neighborhood):  price = <computer, plz do some math for me>  return price`
`def estimate_house_sales_price(num_of_bedrooms, sqft, neighborhood): price = 0 # a little pinch of this price += num_of_bedrooms * .841231951398213 # and a big pinch of that price += sqft * 1231.1231231 # maybe a handful of this price += neighborhood * 2.3242341421 # and finally, just a little extra salt for good measure price += 201.23432095 return price`

## Step 1:

`def estimate_house_sales_price(num_of_bedrooms, sqft, neighborhood):  price = 0  # a little pinch of this  price += num_of_bedrooms * 1.0  # and a big pinch of that  price += sqft * 1.0  # maybe a handful of this  price += neighborhood * 1.0  # and finally, just a little extra salt for good measure  price += 1.0  return price`

# Is machine learning magic?

Interested in computers and machine learning. Likes to write about it.

Interested in computers and machine learning. Likes to write about it.