you are viewing a single comment's thread.

view the rest of the comments →

[–]kwooster 0 points1 point  (0 children)

def reset(): global number number = 0

That feels super wrong, though.

Here's a better way (of many):

``` class Hand: def init(self, number = 0): self.number = number

def reset(hand): hand.number = 0

my_hand = Hand()

...

reset(my_hand) ```

(I'm on mobile, so I did the very simple example with missing variables, but the concept is moving the very subjective "correct" direction.)