Grader showing that my Exercise 3 results is wrong which in fact is actually correct as I have downloaded the csv file and double-check the answer in Google Spreadsheet. Can anyone please confirm and resolve this issue?
Thanks
Grader showing that my Exercise 3 results is wrong which in fact is actually correct as I have downloaded the csv file and double-check the answer in Google Spreadsheet. Can anyone please confirm and resolve this issue?
Thanks
The grader uses different tests.
Just matching the expected answers in the notebook’s tests is not sufficient.
I am sorry I don’t understand. What does that mean? What’s to be done to be sufficient?
There is a mistake in your code.
It does not give the correct results for one of the tests the grader uses.
Tips (these are common mistakes):
Check your code to be sure that it only uses variables that are passed as parameters - do not use global variables or hard-coded values.
A list addition or sum up can be also done by list.append() or
or operator.add() if the lab has imported operator.
ofcourse sum() also is used to add up values.
To know which is the right function, go back to the beginning or previous sections which can provide you hint on the most appropriate function to use here according to grader.
as I am not mentor for this course and do not have access to course, i cannot which is the ideal function autograder is looking for as I cannot access the labs.
try the list.append()
Hi. Can you send me your notebook via direct message? Will check if this is a grader issue or a problem with your code. You can click my name then the blue Message button. Thanks!
I have the same question. Is it a code issue (I have the same code as OP) or is it an issue with the grader?
Hi. Please send me your notebook via direct message so we can check. Ujjval hasn’t sent his notebook yet so we haven’t investigated where the problem is. Thanks.
Sorry! Guys I got a little busy here in a situation. Let me send a DM to @chris.favila then he can give us a solution.
Hi @chris.favila.
I am sending you my notebook in case it helps. It passes all the tests.
Provided that the prior cells are run correctly and `units_sold` is a list, the screenshot shared above should work as it’s exactly the same as what I have.
Hi everyone! Turns out the error in the initial post (Exercise 3) is just a side effect. That’s because the variable total_units_sold is also used in another part of the notebook. Thus, even if your code is correct, it will be affected when this value is recalculated later in the lab. The problem here is actually in Exercise 6. Please check how you defined total_units_sold there. Once you fix that, Exercise 3 will be correctly graded as well. We’ll modify the grader or notebook here so the errors will be more isolated and avoid misdirection. Hope this helps!
Still not working. I just resubmitted without any changes, and the grader now fails ex6.
Submission 1: ex6 failed.
Submission 2 with no changes: ex3 failed, ex6 passed.
Submission 3 today with no changes: ex6 failed. Updated Total Units Sold: 129 (from 127 in ex3 plus 2 units added from ex4)
Also, in the lab it’s called Module 1 Assignment: Analyzing retail sales with Python, but in the course it’s called Practice Programming Assignment: Retail sales analysis , and in the Course Material Grades UI, this Programming assignment is excluded. Is this by design?
Hi, and welcome to the Forum. We haven’t changed anything yet for this lab. As mentioned above, there was an error in the initial post’s code in exercise 6 so it affects both exercise 3 and 6. Once exercise 6 is fixed, both should pass. Please review how you defined total_units_sold there and see the hints.
Thank you for pointing out the lab title and item type. Will report it to the team so we can address it.
Hey guys!
I am a mentor/tester on this course, so let’s see if I can help
I just ran this lab again and tried to replicate some possible errors.
Important notes:
With that said, here is a list of some possible ways to troubleshoot (you can run this once you finish the notebook).
type(units_sold) should be list
type(prices_per_unit) should be list
len(invoice_ids) == len(dates) == len(days_of_week) == len(product_names) == len(units_sold) == len(prices_per_unit)invoice_ids[-1] == 536994
product_names[-1] == "CHRISTMAS CRAFT TREE TOP ANGEL"
units_sold[-1] == 2
prices_per_unit[-1] == 2.1
type(amounts) == list
len(amounts) == len(units_sold)
amounts[-1] == units_sold[-1] * prices_per_unit[-1] (should be 4.2)
type(total_amount) is float or int
type(average_price) is float