【发布时间】:2020-04-22 07:51:25
【问题描述】:
从我读到的here 来看,子作用域应该可以访问在父作用域中定义的变量。但是,就我而言,我在count 上遇到了一个未解决的错误。为什么会发生这种情况?
def find_kth_largest_bst(root, k):
count = 0
def _find_kth_largest_bst(root, k):
if not root:
return None
_find_kth_largest_bst(root.right, k)
count += 1 #unresolved error here??
pass
【问题讨论】:
-
请附上完整的错误信息
-
错误以红色波浪线显示在计数下方,如
unresolved referencecount``