Choose a die and the program will give you the answer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | while again:
print" Pick a dice: "
print"4, 6, 12"
userinput = input("Pick a dice: ")
if userinput == 4:
randomnumber = random.randint(1,4)
print randomnumber
if userinput == 6:
randomnumber = random.randint(1,6)
print randomnumber
if userinput == 12:
randomnumber = random.randint(1,12)
print randomnumber
|
Pretty good. However you have the max number in userinput. No need for the if statements. You can also put the dice choices into a list to allow yourself to easily update it in the future.