摘要: 一、局部变量与全局变量 全局变量:无缩进,顶头写 name = "why" 局部变量:有缩进,可以在缩进所属区域调用 def chang_name(): x = 1 print("chang_name") chang_name() 注: —如果函数的内容无global关键字,有限读取局部变量,只能读 阅读全文
posted @ 2024-01-03 23:51 贫道财迷 阅读(7) 评论(0) 推荐(0)