Kent Johnson wrote:
> Stevie Broadfoot wrote:
>> actually scrap that, it works perfectly :) thank you very much for your
>> help. One last question, does this only work on lists? or will tuples
>> work too and what else?
>
> It will work on any sequence including lists and tuples.
More precisel
Stevie Broadfoot wrote:
> actually scrap that, it works perfectly :) thank you very much for your
> help. One last question, does this only work on lists? or will tuples
> work too and what else?
It will work on any sequence including lists and tuples.
Kent
_
It works for me.
[EMAIL PROTECTED]:~> python /tmp/q.py
hello
there
[EMAIL PROTECTED]:~> cat /tmp/q.py
list = ["hello", "there"]
def printout(firstword, secondword):
print firstword
print secondword
printout(*list)
What does it do?
It passes the arguments from
actually scrap that, it works perfectly :) thank you very much for your
help. One last question, does this only work on lists? or will tuples work
too and what else?
On 4/27/07, Stevie Broadfoot <[EMAIL PROTECTED]> wrote:
This is the best answer i've gotten so far... but its still not working..
This is the best answer i've gotten so far... but its still not working...
what exactly does the star do?
the other solutions people provided do not suit my needs, my printout
function was just an example, what i need it for is more complicated.
I actually just need to feed the members of the li
* Stevie Broadfoot <[EMAIL PROTECTED]> [070426 09:56]:
>I have a list... say for example
>
>list = ["hello", "there"]
>
>and i have a function
>
>def printout(firstword, secondword):
>print firstword
>print secondword
>
>and i want to call
>
>the functio
2007/4/26, Stevie Broadfoot <[EMAIL PROTECTED]>:
> I have a list... say for example
>
> list = ["hello", "there"]
>
> and i have a function
>
> def printout(firstword, secondword):
> print firstword
> print secondword
>
> and i want to call
>
> the function like this
>
> printout(list)
>
>
On 4/26/07, Stevie Broadfoot <[EMAIL PROTECTED]> wrote:
> How can I get around this problem?
def printout(somelist):
for x in somelist:
print x
--
- Rikard - http://bos.hack.org/cv/
___
Tutor maillist - Tutor@python.org
http://mail.python.or
I have a list... say for example
list = ["hello", "there"]
and i have a function
def printout(firstword, secondword):
print firstword
print secondword
and i want to call
the function like this
printout(list)
but that doesnt work because it takes the list as an argument.
How can I get