如何在python中找到掷骰子程序的最小值和最大值

2024-04-25 18:53:52 发布

您现在位置:Python中文网/ 问答频道 /正文

import random
print(' \t Welcome rolling dice game\n ')


while True :
 input(' Press any key to roll')
 roll=random.randint(1,6)
 print(roll)

 stop= input( ' you want to roll. again ? \n if yes then enter y \n if not then enter n\n ')
 if stop=='y':
   continue
 elif stop=='n':
   break


print(' Thanks for Playing:')

Tags: toimportgameinputifrandomdicestop