Saturday, 14 September 2013

Print More than one random number

Print More than one random number

I am new to python and self taught. I would like to create a simple Dice
rolling program but the problem I'm having is How to display more than one
random integer I know I have to specify the dice roll as an integer but
I'm not sure how Ill put part of the code below. # D&D Dice Roller
import random
import time
print("What dice would you like to roll")
sides = input()
if sides == 20:
D20roll = random.randint(1,20)
print ("How many dice would you like to roll")
D20 = input()
if D20 == 1:
print(D20roll)
if D20 == 2:
print(D20roll + "," + D20roll)
if D20 == 3:
print(D20roll + "," + D20roll + "," +D20roll)

No comments:

Post a Comment