摘要: 在写代码的时候,免不了要使用变量。但程序中的一个变量并不一定是在哪里都可以被使用,根据情况不同,会有不同的“有效范围”。 看这样一段代码: def func(x): print ('X in the beginning of func(x): ', x) x = 2 print ('X in the 阅读全文
posted @ 2023-10-28 16:27 Python探索牛 阅读(38) 评论(0) 推荐(0) 编辑