2008-06-17から1日間の記事一覧

Pythonをはじめてみる(5)

print こんなようなことをしたい。 a = Gal(3, 2, 3, 2) print aこれは、__str__という名前のメソッドを定義すればよい。http://www.python.jp/doc/release/ref/customization.html class Gal: def __init__(self, a, b = 0, c = 0, d = 1): self.a = a self…