driver program to test above function
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT pre = [ 8 , 3 , 5 , 7 , 6 ] NEW_LINE size = len ( pre ) NEW_LINE if ( hasOnlyOneChild ( pre , size ) == True ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT