Python论坛  - 讨论区

标题:Re: Re: [python-chinese] 如何写出具有可变参数的函数

2005年07月08日 星期五 20:21

amingsc amingsc at 163.com
Fri Jul 8 20:21:04 HKT 2005

用list传递参数也行嘛
想在list里面放几个就放几个

======= 2005-07-08 17:33:00 您在来信中写道:=======

>必输参数不能省,不定参数前面加*,如:
>func(a, *args)
>这样可以使用
>func(a)
>func(a, b)
>func(a, b, c)
>...
>进行调用
>
>在 05-7-8,guqi<guqi at oasisnet.com.cn> 写道:
>>  
>> 例如: 
>> 定义时func(a,b,c) 
>>   
>> 调用时func(a)或func(a,b)呢. 
>> _______________________________________________
>> python-chinese list
>> python-chinese at lists.python.cn
>> http://python.cn/mailman/listinfo/python-chinese
>> 
>> 
>> 
>
>
>-- 
>I like python! 
>My Donews Blog: http://www.donews.net/limodou
>New Google Maillist: http://groups-beta.google.com/group/python-cn
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        amingsc
        amingsc at 163.com
          2005-07-08


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号