摘要: 在写代码的时候,免不了要使用变量。但程序中的一个变量并不一定是在哪里都可以被使用,根据情况不同,会有不同的“有效范围”。 看这样一段代码: def func(x): print ('X in the beginning of func(x): ', x) x = 2 print ('X in the 阅读全文
posted @ 2020-06-03 18:19 程序员的人生A 阅读(356) 评论(0) 推荐(0) 编辑