question about functions

James Stroud jstroud at mbi.ucla.edu
Fri Apr 15 01:03:17 EDT 2005


Oops, I messed up the indices on the previous post.
Also, maybe you are thinking a bit more perlish:

# start of ascript

def my_funk(*alist):
  print "the first argument: %s" % alist[0]
  print "the second argument: %s" % alist[1]

my_funk('wuzzup,','g?')

# end of ascript

On Thursday 14 April 2005 09:44 pm, chris patton wrote:
> 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?

-- 
James Stroud, Ph.D.
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list