prog11_10.py

class Counter:
    def __init__(self):
        self.value = random.randint(0, 9999)

    def count(self, incr=1):
        self.value += incr

    def reset(self):
        self.value = 0

# プログラム11-10(Counterクラスの定義)