On Thu, 16 Feb 2006 08:04:43 -0800, szabi wrote:
> Hi!
>
> I have a list of three values and want to call a function with four
> parameters. I would like
> to write something like:
>
> a = [1, 2, 3]
> f(*a, 4)
>
> This is syntactically wrong, so is there a function which appends a
> value to a
"szabi" <[EMAIL PROTECTED]> writes:
> I have a list of three values and want to call a function with four
> parameters. I would like
> to write something like:
>
> a = [1, 2, 3]
> f(*a, 4)
f(*a+[4]) seems to work.
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
I have a list of three values and want to call a function with four
parameters. I would like
to write something like:
a = [1, 2, 3]
f(*a, 4)
This is syntactically wrong, so is there a function which appends a
value to a list and
returns the new value, so that I could write something like thi
The question was perfectly answered by Heiko Wundram:
f(*(a+[4]))
I know python is not a lawnmower but a programming language. I can
solve a lot of problems, but I prefer short, clear and nice solutions
to long and/or too powerful ones. So, my problem with my solution (b =
list(a); b.append(4)) wa
szabi wrote:
> I have a list of three values and want to call a function with four
> parameters. I would like
> to write something like:
>
> a = [1, 2, 3]
> f(*a, 4)
>
> This is syntactically wrong, so is there a function which appends a
> value to a list and
> returns the new value, so that I c
szabi wrote:
> a = [1, 2, 3]
> f(*a, 4)
f(*(a+[4]))
--- Heiko.
--
http://mail.python.org/mailman/listinfo/python-list