Module 3- Assignment 1 Issue

After using both for loop version or iterator version still getting error on unittests and cannot pass it.

(assignment) jovyan@b0df6ebc0dd4:~/work/assignment_part_1$ python unittests.py
Initial list: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
Indices to remove: {0, 2, 4, 5, 6, 8, 11, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 27, 28}
List after removal: [2, 4, 8, 10, 11, 13, 18, 24, 26, 27, 30]
Modified list: [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 30]
Magic summation is equal to: 42
Failed test case: magic_summation executed properly, but output is incorrect for parameters n = 30 and seed = 10.
Expected: 46
Got: 42

any suggestions

when submitting assignment get following error
Failed test case: magic_summation executed properly, but output is incorrect for parameters n = 33 and seed = 67.
Expected:
55,
but got:
54.

but when using python2.7 version not gave correct result
(python27) jovyan@b0df6ebc0dd4:~/work/assignment_part_1$ python magic_summation_python27.py 33 67
Magic summation is equal to: 57.

how to find updated version of magic_summation_python27.py?

on backup data also shows month old version

I responded to you right, if you still cannot find the refreshed version I will send you my copy in private!

I have the same issue. Do you mind sharing the refereshed version with me?

Same Issue,

(assignment) jovyan@8210de123c5f:~/work/assignment_part_1$ python unittests.py
Magic summation is equal to: 42.
Failed test case: magic_summation executed properly, but output is incorrect for parameters n = 30 and seed = 10.
Expected: 46
Got: 42

Another version of the file shows,
(assignment) jovyan@8210de123c5f:~/work/assignment_part_1$ python --version
Python 3.6.15
(assignment) jovyan@8210de123c5f:~/work/assignment_part_1$ python unittests.py

Failed test case: magic_summation executed properly, but output is incorrect for parameters n = 30 and seed = 10.
Expected: 46
Got: 47

Also tried everything but still stuck in it.
Even git all passed message from an unites.py, but still no luck with a final checks.
At the same time py2.7 and py3 version produced the same result so not sure what is missed there.

So far most disappointed assignment ever :slightly_frowning_face:

1 Like

Can you guys try and refresh the workspace:

https://www.coursera.org/learn/team-software-engineering-with-ai/supplement/qEB8o/optional-downloading-your-notebook-and-refreshing-your-workspace otherwise @lucas.coutinho could make some adjustment to the folder of the Lab or the back up copy. It was pretty easy for me to pass this assignment with the new version!

hm, ok find out that backup cope is a way outdated than in the assignment folder, will try with that code

finally got it sorted out, the main problem was in the outdated bakcup files some make sure to use 2.7 version in the assignment folder

1 Like

Hi! I’ve updated the Lab and still getting the same error: (assignment) jovyan@2ff5835ceb78:~/work/assignment_part_1$ python unittests.py
Failed test case: magic_summation executed properly, but output is incorrect for parameters n = 30 and seed = 10.
Expected: 46
Got: 42

Now my code passes the unittests.py, but fails during submission

Please post a screen capture image that shows the grader’s detailed report.

Here you go. Thank you!

The unittests.py file was last updated on Oct 21, 2024. That’s 13 days ago.
Your File Browser data shows your version is 24 days old.
Please get the latest copy. Then run all of the notebook tests again.

You have to delete your old file and then use “Get latest version”.

1 Like

Note that your magic_summation.py and instructions.md files may be obsolete also.

I’ve deleted all the files in assignment1 and updated to the latest version, but the new files I get are the same ones ‘modified 24 days ago’. Should I try to reboot the server?

It would not hurt, but I doubt it would help either.

I tried rebooting, tried updating to the latest version again, tried cleaning cache, tried it on both Mac and Windows, same result: The files are ‘modified 24 days ago’. What else can i do?

Apparently you have the correct files, but the code you’re adding is not correct.

Ok. I don’t know what happened but it works. Now I have a more intriguing question: “Why does it work?” haha. Thanks, anyway! Have a good day!

2 Likes