Getting the customer_service_bot_solution to run, is there an error in it?

1 Like

The error says:
NameError: name ‘new_customer’ is not defined

This means you are using the variable name new_customer while it has not been set before.

Here are a some causes:

NameError: global name ‘—’ is not defined

Python knows the purposes of certain names (such as names of built-in functions like print). Other names are defined within the program (such as variables). If Python encounters a name that it doesn’t recognize, you’ll probably get this error.

Some common causes of this error include:

  • Forgetting to give a variable a value before using it in another statement
  • Misspelling the name of a built-in function (e.g., typing “inpit” instead of “input”)


If you are still stuck you will need to provide you’re code, for us to point out.

Well… I figured it out…

For the tutorial you call cs_service_bot() right after you make the function as a test and well… of course none of the variables are defined because where just testing the input… idk how I missed that.

Thank you.