Creating variables on the fly...
Brendan Hahn
bhahn at spam-spam.g0-away.com
Mon Apr 3 19:53:05 EDT 2000
More information about the Python-list mailing list
Mon Apr 3 19:53:05 EDT 2000
- Previous message (by thread): Creating variables on the fly...
- Next message (by thread): Odp: Odp: Python on Alpha OpenVMS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Matthew Hirsch <meh9 at cornell.edu> wrote: >I like this solution. How do I use the apply function in the body to >call add()? (I won't know ahead of time how many arguments are going in >the function). You would "apply(add, list-or-tuple-full-of-arguments)". You don't really need a separate add-up-a-list function, though, you can use reduce: "reduce(operator.add, list-or-tuple-full-of-arguments)". bhahn at transoft.mmangle.net <-- unmangle address to reply
- Previous message (by thread): Creating variables on the fly...
- Next message (by thread): Odp: Odp: Python on Alpha OpenVMS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list