Very simple request about argument setting.

Hakusa at gmail.com Hakusa at gmail.com
Mon Oct 30 02:59:57 CET 2006


I have the argument items in my class room.

class room:
	def __init__(self, name, description, items*):

I thought I remembered from a tutorial I read once, and I've read so
many I feel like an expert of them, that putting a little star* above
an item makes it accept the argument as a list. But when I tried this,
I got an invalid syntax error message.

So:
Question 1: How can I create an argument that accepts a list of
variable?

Question 2: How do I signify to accept each item as one list? (my bet's
on using another set of parens)

Question 3: Or am I going about this all wrong and should always create
a list before the fuction call and use the list in the function call?




More information about the Python-list mailing list