我在学二叉树的最大路径和时,如果节点为None,我们应该输出两个最小值
然后答案是
return float('-int'), float('-int')
我知道:
float('inf') 表示正无穷
-float('inf') 或 float('-inf') 表示负无穷
float('-int')就么见过。。。
>>> float('int')
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
float('int')
ValueError: could not convert string to float: 'int'
>>> float('-int')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
float('-int')
ValueError: could not convert string to float: '-int'