How to receive python's array in function -


how receive array (like numpy ones) function? let's array a = [[2],[3]] , function f. tuples works this:

def f((a ,b)):     print * b  f((2,3)) 

but how arrays?

def f(#here):     print a*b  f([[2],[3]]) 

tuple unpacking in function arguments has been removed python 3, suggest stop using it.

lists can unpacked tuples:

def f(arg):     [[a], [b]] = arg      return * b 

or tuple:

((x,), (y,)) = 

but use indexes:

return arg[0][0] * arg[1][0] 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -