我正在尝试制作一个基本的骰子滚轮。当我在 Codeskulptor 中运行该程序时,它会在 randint 函数上引发错误。我可以不使用raw_input
插入变量来设置它的范围吗?我应该使用其他功能吗?
"""Program to roll random numbers within the ranges set."""
import random
sides_of_die=raw_input("Enter how many sides your die has: ")
number_of_dice=raw_input("Enter number of dice you have: ")
total=sides_of_die*number_of_dice
rollinput=raw_input("Would you like to roll now?")
rollinputcap=rollinput.upper()
if rollinputcap =="Y":
print random.randint(number_of_dice,total)
else:
print "What do you want then?"