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:')
答案 0 :(得分:2)
尝试:
min = 6
max = 0
while True :
input(' Press any key to roll')
roll=random.randint(1,6)
print(roll)
if roll>max:
max = roll
if roll<min:
min = roll