在 2012年2月17日星期五UTC+8下午5时55分11秒,Nobody写道:
> On Fri, 17 Feb 2012 16:53:00 +0900, Zheng Li wrote:
>
> > def method1(a = None):
> > print a
> >
> > i can call it by
> > method1(*(), **{'a' : 1})
> >
> > I am just curious why it works and how it works?
> > and what do *() and **{'a' : 1} mean?
>
On Fri, 17 Feb 2012 16:53:00 +0900, Zheng Li wrote:
> def method1(a = None):
> print a
>
> i can call it by
> method1(*(), **{'a' : 1})
>
> I am just curious why it works and how it works?
> and what do *() and **{'a' : 1} mean?
In a function call, an argument consisting of * followed by
On 17 February 2012 07:53, Zheng Li wrote:
> def method1(a = None):
> print a
>
> i can call it by
> method1(*(), **{'a' : 1})
>
> I am just curious why it works and how it works?
> and what do *() and **{'a' : 1} mean?
>
> when I type *() in python shell, error below happens
>
> File "",
def method1(a = None):
print a
i can call it by
method1(*(), **{'a' : 1})
I am just curious why it works and how it works?
and what do *() and **{'a' : 1} mean?
when I type *() in python shell, error below happens
File "", line 1
*()
^
SyntaxError: invalid syntax
--
http://m