
Patrick B. answered 02/19/21
Math and computer tutor/teacher
import math
iNums = []
iSum=0
for i in range(6):
iRandomNum = random.randint(1,6)
iNums.append(iRandomNum)
iSum = iSum + iNums[i]
iGuess=0
while (int(iGuess)<6):
iGuess = input("What is the total of the dice?? :>")
iDifference = int(iGuess) - int(iSum)
for i in range(6):
print("Dice # " + str(i+1) + " is " + str(iNums[i]))
print("Total : " + str(iSum))
print(" You guess is " + str(iGuess))
print(" Difference is " + str(iDifference))
if (iDifference>0):
print("You went over... YOU LOSE!")
if iDifference==0:
print("BINGO!!! Congratulations: You gussed the total !!! You win the game")
if iDifference==-1:
print(" You are so close ")
if iDifference==-2:
print(" You are getting closer")
if iDifference==-3:
print(" You are in range")
Ethan H.
thank you02/19/21