Week 4 Assignment 1 Exercise 10 Problem

My code gives the expected output but it raises an error. Please help

Hey @khoa.nguyen311202 , your code passes only 2 tests, but fail the third one. As the error suggests, please avoid using global variables and/or hard coded values within your function.

Check for that and let me know.

Thank you for your reply
However, I don’t really understand this term “avoid using global variables and/or hard coded values within your function.”

For example, sometimes the requirements is to say, pass number of classes as a parameter
the correct way would be: n = n_classes
the incorrect way would be passing hardcoded value: n = 5

Oh I have just checked for that but it seems that my code was written in the correct way…

oh okay. Could you DM me your notebook then ? I’ll take a look. Here’s how you can download it: How to Download Your Notebook

1 Like

As mentioned in the DM to you @khoa.nguyen311202 you were using an older version of the assignment, which had outdated code for ex 10.

1 Like