C2_W4_Decision_Tree_with_Markdown Ex 4

I am getting this error message. Any help in debugging would be appreciated. I have looked at the hints and do not see how my code differs.


From the error it seems the error is not choosing the best spilt.
If you send it to me in a direct message I can take a look.

Hi @Niall_Boyd ,

To get some idea of what is happening, you can put a print statement just below the ‘for’ loop to print out the value of all the variables that are important in the calculation.

Thanks, printed out some of the variables and noticed max wasn’t being updated, and fixed a typo in the variable. Thanks for the help

Hi @Niall_Boyd ,

Great to hear you have solved the problem. I found using print statement for debugging is simple and very useful. Of course, there are debuggers as well, but that will come later.