On Sat, Jul 2, 2011 at 4:47 PM, David Merrick <merrick...@gmail.com> wrote:

> Each player needs to be able to bet
>

Traceback (most recent call last):
>   File "I:/Python/Python Source Code/chapter09/blackjackBetting.py", line
> 204, in <module>
>     main()
>   File "I:/Python/Python Source Code/chapter09/blackjackBetting.py", line
> 196, in main
>     game = BJ_Game(names)
>   File "I:/Python/Python Source Code/chapter09/blackjackBetting.py", line
> 120, in __init__
>     bet = BJ_Player(name).betting(stash = 10)
> TypeError: betting() got multiple values for keyword argument 'stash'
> >>>
>
>

The "(stash = 10)" syntax is only used in the function (or method, in this
case) definition.  It means that "stash" is optional: if no value is
supplied for "stash", then it will be assigned a default value of 10.

So you have choices: all of the following will invoke "betting" with "stash"
having an initial value of 10.
    By value:

>         bet = BJ_Player(name).betting(10)
>
    By passing a variable:

>         pari = 10
>
        bet = BJ_Player(name).betting(pari)
>
    By default:

>         bet = BJ_Player(name).betting()
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to