I want to implement the decision-tree learning alogorithm.

I am pretty new to coding so I know it's not the best code, but I just want it to work. Unfortunately i get the error: `e2 = b(pk2/(pk2 + nk2))
ZeroDivisionError: division by zero`

Can someone explain to me what I am doing wrong?