2008-08-29から1日間の記事一覧
Rubyのチュートリアル『プログラミング入門 - Rubyを使って - 』9.クラスの『クラスを作る』あたりをPythonでやってみた クラスを作る import random class Die: def roll(self): return random.randint(1, 6) dice = [Die(), Die()] for d in dice: print d…
牌語備忘録 -pygo
Rubyのチュートリアル『プログラミング入門 - Rubyを使って - 』9.クラスの『クラスを作る』あたりをPythonでやってみた クラスを作る import random class Die: def roll(self): return random.randint(1, 6) dice = [Die(), Die()] for d in dice: print d…