Quoth "chris patton" <[EMAIL PROTECTED]>:
| Hi everyone.
|
| I have a question about passing arguments to python functions. Is there
| any way to make this job act like Perl?
|
| sub my_funk {
|
| print "the first argument: $_[0]\n";
| print "the second argument: $_[1]\n";  }
|
| In other words, can I call the arguments from a list?


        def my_funk(*a):
                print 'first', a[0]
                print 'second', a[1]

        my_funk('one', 'two')

You can mix this with normal argument usage, and there is a
similar way to pass parameters to a function from a tuple.

        Donn Cave, [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to