Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Howto pass Array/Hash into Function

Reply
Thread Tools

Re: Howto pass Array/Hash into Function

 
 
Gabriel G
Guest
Posts: n/a
 
      10-03-2006
At Tuesday 3/10/2006 06:05, Wijaya Edward wrote:

>How can I pass Array, Hash, and a plain variable
>in to a function at the same time.
>
>I come from Perl. Where as you probably know
>it is done like this:
>
>sub myfunc {
>
> my ($plain_var, $hash_ref,$arref) = @_;
> # Do sth with those variables
>
> return;
>}


In Python your functions have formal arguments:

def myfunc(plain_var, some_dict, some_list):
# ...
return

You also have positional and keyword arguments, and default values.
Read the Python tutorial <http://www.python.org/doc/current/tut/tut.html>



Gabriel Genellina
Softlab SRL





__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pass function into another function as parameter? soni2926 Javascript 4 11-21-2008 05:40 PM
Howto pass Array/Hash into Function Wijaya Edward Python 6 10-03-2006 07:09 PM
Trying to pass values of variables from a redefined function into another function deanfamily C++ 4 10-23-2005 11:36 PM
Howto: Class member function as callback function for dialog box prettysmurfed C++ 6 07-22-2003 06:17 PM
HowTo: pass data from server to client?? Wilhelm Pieper ASP .Net 0 06-25-2003 02:57 PM



Advertisments