1. 首页
  2. 数据库
  3. 其它
  4. python函数缺省值与引用学习笔记分享

python函数缺省值与引用学习笔记分享

上传者: 2020-12-31 16:53:07上传 PDF文件 34.24KB 热度 19次
复制代码 代码如下:import random, stringclass C(object): passdef dangerFunction(msg, l = [], b = {}, c = C()): print msg, ‘-‘*10 print l, b, c.__dict__ l.append(1) b[random.choice(string.ascii_lowercase)] = ” c.__dict__[random.choice(string.ascii_lowercase)] = “” print l, b, c.__dict__da
下载地址
用户评论