import random
rolls = int(input("Enter number of dice rolls: "))
counter = 1
summ = 0
print(str(rolls) + " dice rolls using a Python loop:")
while counter <= rolls:
dice = random.randint(1, 6)
print(dice)
counter += 1
summ += dice
print("The sum of all dice was: " + str(summ))
Py2.x