On 9/16/2010 8:18 AM, Ken Green wrote:
I am unclear on the behavior of using a function. Below is a short code I wrote to print an amount out after inputting the number of match.

# TEST Function.py

def change(amount):
    if match == 1:
        amount = 0
    if match == 2:
        amount = 0
    if match == 3:
        amount = 3

[snip]

How about:

def change(amount, amts={1:0, 2:0, 3:3}):
    return amts[match]

--
Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to