ダイス シムのエラー メッセージを作成しようとしています
import random
loop=1
while loop == 1:
dice=input("Choose dice 4,6 or 12 sided")
if dice =="4":
n=random.randint(1,4)
print(dice)
print(n)
if dice =="6":
n=random.randint(1,dice)
print(dice)
print(n)
if dice =="12":
n=random.randint(1,dice)
print(dice)
print(n)
else:
print("Error")
エラーは4と6で発生しますが、12面を使用するとエラーは発生しません
Choose dice 4,6 or 12 sided4
4
4
Error