-3

pick = 4 と 6 と 12 ありがとう

import random 
print("Are you feeling lucky today?")
loop='y'
while loop=='y':
    pick=int(input("Select your dice(4,6,12) then press enter:"))
    if pick in [4,6,12]:
         print("The "+str(pick) +" sided dice was thrown and your score is "+str(random.randint(1,pick)))
else:
    print("Invalid number. You are meant to select a 4, 6 or 12 sided dice!")
loop=input('Dare to go again?(y/n)?')
if loop=='n':
    print("Thanks for playing!")

input("Enter キーを押して終了します:")

4

1 に答える 1