if randomRoll == 2 or randomRoll == 3 or randomRoll == 12:
winCount = winCount + 0
if randomRoll == 7 or randomRoll == 11:
winCount = winCount + 1
else:
The second if
should be elif
. You don't want the else
to be entered if the roll is 2, 3, or 12.
while PointForRoll != 7 or PointForRoll != randomRoll:
The or
should be and
. While the roll isn't 7 and the roll is not the point.
if PointForRoll == randomRoll:
winCount=winCount
if PointForRoll == 7:
winCount=winCount+1
This is backwards. Rolling a 7 is a loss. Hitting the point is a win. You should be incrementing the win count in the first if
.
return PointForRoll
Delete this line. You should not be returning from this loop.
while PointForRoll != 7 and PointForRoll != randomRoll:
...
Finally, you never reset PointForRoll
after this loop ends. Add PointForRoll = 0
either right before or right after the loop.
With all of these changes made, I get a win rate right around 50%.