导航

丢个骰子

Posted on 2019-07-29 16:42  苏格拉底编程器  阅读(113)  评论(0)    收藏  举报
###Concepts:
* Build-in module.
* Practice on module, class, object, tuple.
###Codes:
import random
class Dice:
def roll(self):
first = random.randint(1, 6)
second = random.randint(1, 6)
third = random.randint(1, 6)
forth = random.randint(1, 6)
fifth = random.randint(1, 6)
return first, second, third, forth, fifth
dice = Dice()
print(dice.roll())