摘要:
1 class Solution: 2 def binaryTreePaths(self, root: TreeNode) -> List[str]: 3 def binaryTree(root,path): 4 if root: 5 path+=str(root.val) 6 if not roo 阅读全文
摘要:
一、global global关键字用来在函数或其他局部作用域中使用全局变量 1.1 如果局部要对全局变量修改,而不使用global关键字 count = 0 def global_test(): count += 1 print(count) global_test() 会出现如下错误: Unbo 阅读全文