Logiccal statement error

if (root.left and root.right ) is not None:
return root

statement not working as expected