Count Good Nodes In Binary Tree Python