[Tutor] arguments

emilia12 at mail.bg emilia12 at mail.bg
Thu Feb 15 14:12:48 CET 2007

Hi list,

I have a function with two arguments (say f(x,y))
and second which returns tuple (say def g(): return (xx,yy))

my question is how to put returned values from g() as
arguments to f ?

the direct way generates error:

TypeError: ff() takes exactly 2 arguments (1 given)

and the hard way is
x, y = g()

is ok but it uses two extra variables. Is there a simple way
to do this?

BTW f(g()[0], g()[1]) works too, but calls function g()
twice ...

thanks in advance


SCENA - Единственото БЕЗПЛАТНО списание за мобилни комуникации и технологии.

More information about the Tutor mailing list