[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:
f(g())
TypeError: ff() takes exactly 2 arguments (1 given)
and the hard way is
x, y = g()
f(x,y)
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
e.
-----------------------------
SCENA - Единственото БЕЗПЛАТНО списание за мобилни комуникации и технологии.
http://www.bgscena.com/
More information about the Tutor
mailing list