摘要: 1.Python的函数的默认值 在Python中定义默认值就像这样: def foo(x=10) print x 另外,也可以使用变量来作为参数的默认值,如: a=10def foo(x=a) print a a=12print foo() #It will print 10 对于上面来说,默认函数参数的值在被赋值时就指定,后面的a=12,改变不了x的值。但是... 阅读全文
posted @ 2006-04-03 21:36 shipfi 阅读(273) 评论(0) 推荐(0) 编辑