Name 'test' is not defined error

I am practicing “Python Basics with Numpy”.

When I tried to execute exercise 1 after typing print(“Hello World”), I am getting the following error

NameError                                 Traceback (most recent call last)
<ipython-input-5-9c535d708bb1> in <module>
----> 1 print ("test: " + test)

NameError: name 'test' is not defined

I tried restarting the kernel, but it didn’t work. What could be the issue?

Please run the cells in order from the top and fill code only where instructed. This way, variables like test will be defined before getting used in the print function. Do read the instructions to check what the variable test should be defined as before accessing it inside the print function.

1 Like

I ran the cells in order. Still I am seeing the same failure. The cell where I added print statement is executing fine(printing Hello World) but the test cell is still giving the same failure.

My bad. It worked.

2 Likes