This function (playCraps()) is supposed to choose two random integers between 1 and 6, sum them up, and return a True or False value held in x.
For some reason, each time I run the program, it always returns True with either 7 or 11.
import random
wins = [7, 11]
losses = [2, 3, 12]
def playCraps():
x = 0
while x == 0:
sumDice = random.randint(1,6) + random.randrange(1,6)
if sumDice in wins:
x = True
elif sumDice in losses:
x = False
else:
sumDice = 0
print("The sum of the dice was " + str(sumDice))
print("So the boolean value is " + str(x))
Why does this happen? And how can this be fixed?