No Output when I am running the code

I am working on the “Guided Project: Predicting House Sale Prices”

The code I was working with working fine yesterday. Now I am getting an error. Same code. I don’t know what’s wrong. Could you please review and give me feedback? Also, there are no outputs in the other two codes. Very strange.

https://app.dataquest.io/m/240/guided-project%3A-predicting-house-sale-prices/2/feature-engineering

please explain in more detail the issues you are having, It would greatly help if you paste your code here…

image

I can see multiple issues in this piece of code, lets start by a basic understanding every programmer should have :

  • You define a function.
  • You CALL the function.
  • You deal with the return of your function.

in the example above you did not Call the function!!

this is how it would look:

def train_and_test(data):
    ...
    ...

our_output = train_and_test(our_data)  # here we CALL the defined function!

print(our_output)                      # here we print the return of the function !!

Also, try to ALWAYS understand the error message…

here you got:

    NameError: name 'rmse' is not defined

This means that the variable name ‘rmse’ can not be found!!
and that makes sense, as variables defined within a function cannot be accessed from the outside (aka local variables), that’s why you have to return them!!