#!/usr/bin/python
# 5 dice
import random
dice = [0,0,0,0,0]
throw = 0
def roll():
return (random.randint(1, 6))
def check_ones(d):
sum = 0
for x in range(5):
if d[x] == 1:
sum = sum + d[x]
return(sum)
for x in range(5):
dice[x] = roll()
throw = 1
print("dice roll " + str(throw) + " is " + str(dice))
while throw < 3:
selected = input("Throw which dice?")
for x in range(5):
if str(x+1) in selected:
dice[x] = roll()
print("throwing " + str(x+1))
else:
print("holding " + str(x+1))
throw += 1
print("dice roll " + str(throw) + " is " + str(dice))
print("End")
print("ones:" + str(check_ones(dice)))