Problem with the information gain exercise 3

Hello @AlvaroViudez,

Debugging is part of the assignment, and sometimes it’s just not a straight forward thing but this is part of life, right? Here I can give you one more suggestion. You must have used some variables in your code to temporarily store all the intermediate results, what you can do is to add a line each time you store an intermediate result, and the line is print(variable_name) where you need to replace variable_name with the name of that variable.

Printing the content of those variables allows you to inspect the progress of your own code, so that you can ask yourself whether the content is correct or not, and if one of those printing results does not match with your expectation, then you know better where the bug is.

An alternative way to print the content is to add a number such that it becomes, for example, print(1, variable_name). If you are storing 5 intermediate results, you will have to do 5 printing, so in order to distinguish one printing result from another, you might add a different number to each of those 5 printing lines.

We can’t access your account and we won’t. Your assignment is yours and as I said, debugging is part of that work, so I am afraid you will have to keep trying. However, it is my personal experience and also some learners’ experience that sometimes it makes a difference just by taking a break and I believe a break can help reset your focus so that next time when you debug your code again, you might discover what you had overlooked. Since there is a bug and you couldn’t find it, then something must have been overlooked.

Good luck @AlvaroViudez, as you also know, you are not the only one who encountered an error like that, and I believe you will also be one of them who is able to figure it out yourself.

Cheers,
Raymond

1 Like