My code works properly but i keep getting the message
Failed test case: Detected incorrect number of valid print statements (with f-strings). Grader expected: 1 You got: 0
I tried copying the text word for with the approprite spaces to fix the issue but it still wont reconize my f string
if book [“overdue”]== True:
print (f"Book is overdue - Contact {book[‘borrower’]} to return it")
heres my if statement with the f string and like i said i copied the text from the output but kept the part where i used my key from dictonary to keep the output dynamic.
Book is overdue - Contact Arthur Dent to return it.
Book is overdue - Contact Arthur Dent to return it
these are the two outputs, the top one is the one my code created and the bottom one is the one in the expected section. I have tried messing with the quotations to swap single and double quotes but i really dont know what else to do since i am getting the right answer.
I finished Mod 2 Programming Exercise but got an Unexpected Error from the Grader and received 0/10 points. I don’t understand as it passed the Test check. [I spent a lot of time fixing details (curly braces, square brackets, etc! Phew!) Anyone has this error?
Grader Error: Grader feedback not found
Visit the Discussion forum to see if your peers are experiencing or have found resolutions for similar errors. If the error isn’t resolved in 24 hours, please reach out to Coursera through our Help Center.
Ah, I might have unwittingly deleted a line of the instructions or moved things around as I was figuring if they were getting in the way of the code (newbie here), ugh. I’ll go check. I didn’t download/reupload the notebook. What do I need to do then? Do I need to resubmit or just leave it as is? I got 80%.
I recommend you rename your notebook, then use the “Get latest version” tool, and complete the assignment again.
“Get latest version” will give you a new copy of the notebook so you can start over.
Note that it only replaces missing files - that’s why you have to rename your current notebook first.
You have unlimited attempts for the programming assignments. No limits.
You can use any filename you want, just be aware that you can never grade a renamed notebook. So it’s only for your personal reference.
The grader ALWAYS uses the notebook with the original filename. It doesn’t matter what the name is on the notebook you have open - the grader always looks for the original file.
The “Get latest version” tool is under the “Lab Help”, it’s the question-mark icon in the upper right corner of your browser.
Thanks again, let me restate this so I understand what you are saying, .
If I rename the notebook, it means I’m starting over with the original file name and submitting it afresh as the grader will be looking for the original file only. The older file is renamed for my personal reference, right?
When I upgrade to the latest version, the instructions say “… Move your existing files into a new folder before continuing.” Am I moving my existing notebook file to a “new folder” on my own drive?
Sorry I have so many questions. I just want to make sure I don’t mess up again.
Update: I shutdown the old notebook that was running. Then I restarted and cleared all outputs. Then I ran Ex 1, and bingo! It passed the test!
I will be ok now. Thanks! No need to reply to me. [ ]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
It’s me again. I now have an initialization issue for Ex 1. Is it because I have duplicate notebooks? I restarted and cleared output but it still gives me this error message:
Failed test case: The variable ‘book’ should be initialized exactly once. Please ensure it is initialized only once, and as a Python Dictionary as instructed in the exercise.
Grader expected: One initialization of ‘book’
You got: 0 initializations of ‘book’
I think I might need to move my old notebook to another folder per instructions as it is still running. I looked at the file structure and my old file is still ‘running’. But I’m not sure how to move it to another folder?
Try restarting the kernel. That’s in the “Kernel” menu.
Or…
Use the File menu, then Open, then find the file with green highlighting that says “Running”. Click on the checkbox next to it, and then click on the “Shutdown” button.
Then (still in the File → Open menu) double-click on your lab notebook filename. That will open the new file.
Well, I resubmitted the assignment and the crazy thing is it says now that my Ex 1 (not Ex 3) has a grading error. LOL. I’m not sure what I have done wrong this time. I might try resubmitting but I think this grader does not like me.
I tried again for the third time, and for my persistence, the grader finally awarded me a 100%. I was very careful not to move anything beyond what I entered.
Thanks for your assistance! I can finally move on to Module 3!