from random import randint
class Die():
def __init__(self,sides = 6):
self.sides = sides
def roll_die(self):
x = randint(1,self.sides)
print(x)
zhishaizi_1 = Die(6)
for side in range(6):
zhishaizi_1.roll_die()
print("\n")
zhishaizi_2 = Die(10)
for side in range(10):
zhishaizi_2.roll_die()
print("\n")
zhishaizi_3 = Die(20)
for side in range(20):
zhishaizi_3.roll_die()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)