elegante zuweisung gesucht

B

Benny Mohr

Hallo ihr Cracks,

ich habe eine einfache Funktion

def myFunc(a,b):
pass

und eine Liste

myList = [1,2]

und möchte gerne auf diese Weise aufrufen:

myFunc(myList)

Geht leider nicht - gibt es Alternativen ohne myFunc zu ändern?


Besten Dank
Benny
 
G

Gerhard Haering

Hallo ihr Cracks,

ich habe eine einfache Funktion

def myFunc(a,b):
pass

und eine Liste

myList = [1,2]

und möchte gerne auf diese Weise aufrufen:

myFunc(myList)

Geht leider nicht - gibt es Alternativen ohne myFunc zu ändern?

myFunc(*myList)

Btw. English is the preferred language on this list. If, however, you
want to talk about Python in German, then this is the list for it
python-de mailing list: http://python.net/mailman/listinfo/python-de

Good luck in your Python course :p

-- Gerhard

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBngxcdIO4ozGCH14RAj4nAJ9JOhYXyxCnk6WTaDiFsZMeC6bUWgCePVib
i2AOd2uYGzehFtleI+J5iY4=
=OIxV
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top