In the attached screen image line 3 shows exercise 1.a was completed correctly. The output from line 4 matches the expected output. And line 5 shows the results from testing.
Any guidance on why this is failing will be appreciated.
Thanks, J
In the attached screen image line 3 shows exercise 1.a was completed correctly. The output from line 4 matches the expected output. And line 5 shows the results from testing.
Any guidance on why this is failing will be appreciated.
Thanks, J
Also, in addition to having autosave activated, I manually saved prior to running the code in line 4 and again for line 5.
Hi @JDS_ATL ,
The test script check your print statement based on its formatted rule, and it would output an error message if your print statement failed the formatted rule. Try removing any space between the print and the open bracket, it should look like this:
print(
In general, be aware that passing the tests in the notebook does not mean your code is perfect. The grader uses a different set of tests.
Hi @JDS_ATL,
Additional to what Kin mentioned (print( is correct, print ( is not correct), please make sure you are working and executing your code in the assignment file with the name C1M1_Assignment.ipynb.
If you are working in a file with any other name than this default name, you will not only fail the tests, you’ll fail the grader as well, even though you implementation might be perfectly correct.
Best,
Mubsi
Also, in the screenshots you shared, one of them has the “Expected Output” cell, the other does not. Please do not remove any cells from the notebook. That will also cause you problems.
I have rebooted and attempted this using the Edge and Firefox browsers. The new screen image below is using Firefox; the image I posted yesterday used Edge.
You’ll see I’ve added clarifying text indicating the left side is my work and the right side the DeepLearning assignment. “Expected Output” should not actually print as part of the assignment; further indicated by the sample code.
To ensure there are no issues with spaces: I copied the sample code in the assignment, pasted that line 3 times and renamed the f string according to the instuctions (shown with red in the screen image), and updated the f string elements with the naming convention from the prior part of the lesson. (The results from line 3 show that naming convention is correct- highlighted with green in the image below).
I understand showing code is against the rules and the image blocks out the only part of the code that’s not already provided in the assignment comments.
With respect to executing code using C1M1_Assignment.ipynb: I’m opening a new notebook from the assignment page- I’m not opening any saved files.
I appreciate the assistance working through this issue.
Yes, it should print the bold text “Expected Output”, because that is part of the notebook markdown. It’s not part the executable code.
Why is your notebook not displaying text “Expected Output”?
If I understand correctly, you have created a new notebook, and you are working in it ?
That’s what I said earlier. You have to work in the notebook titled C1M1_Assignment.ipynb. Things will not work if you are working in a notebook that is not this one.
I’m going to send you a direct message so that we can have a more flexible conversation.
For others looking for the solution, Jay was working in a notebook file called Untitled4.ipynb. Instead of the default notebook, which in this case is C1M1_Assignment.ipynb.
Always work in the notebook that opens when you open an assignment. First, work in that notebook, pass the tests, get your grade, and then feel free to play around and experiment. Otherwise, you’ll get yourself in all sorts of unpredictable scenarios.
The assignments are designed in a certain way, and they need to be attempted as intended, as instructed.
This doesn’t solve my issue. I have the exact same problem as JDS_ATL, yet my notebook is called correctly (see screen shot #2). I am not sure how to proceed.
s. shot #1
{mentor edit: code removed}
{mentor edit: code removed}
Do you see the square brackets that don’t have a number inside?
That means you haven’t run this cell yet.
That’s why the next cell says that “book_title is not defined” - because you haven’t run the code that defines it. Editing a cell is not sufficient, you also have to run it.
Note: In the future, please do not share your code on the forum. That is not allowed by the Code of Conduct.
It is usually sufficient to just post screen capture images of the error messages.