title: While loop won't stop in python
body: <p>We are trying to make a python program to simulate games of craps and display the probability of winning. I have narrowed down the answer to the while loop and as the title suggests, when it hits the loop it won't exit. As far as I can tell the loop should exit but instead just returns and endless train of "false". Here is the code for the whole program with comments, I'll type out the rules for craps (as far as what we're using for our program) at the bottom.</p>
  
  <pre><code>import random
  def craps()
      roll = random.randint(1,6) + random.randint(1,6)
  if (roll == 7 or roll == 11): #Tests if the player should win. If so it adds a 1 to the win counter 
      return 1
  elif (roll == 2 or roll == 3 or roll == 12): #Tests if player should lose. If so adds 0
      return 0
  else:
      roll2 = 0 #initializes roll2 for the while
      while (roll2 != roll or roll2 != 7): #The player keeps rolling until they get a 7 or the initial roll
          roll2 == random.randint(1,6) + random.randint(1,6) #Rolls the dice
          if (roll2 == roll): #Tests if the player should win
              return 1
          elif (roll2 == 7): #Tests if the player should lose
              return 0
  
  win = 0 #Start the win counter at 0
  games = int(input("Enter the amount of games you want played: ")) #Accept how many games will be played
  for i in range (games): 
      win = win + craps() #adds a 1 or a 0 depending on if a game was won
  
  print ("The probability of winning is:", win, "/", games, " =", float(win)/games) #print the probability of winning
  </code></pre>
  
  <p>The basic rules we are using are: the player rolls 2 six sided dice, if the initial roll is a 7 or 11 the player wins (line 4). If the player rolls a 2, 3 or a 12 the player loses (line 6) If the player doesn't get either they keep rolling until they match the initial roll or roll a 7. If they match the initial roll they win, if they get a 7 they lose (lines 10-15). Our program is supposed to simulate and display the probability of the player winning.</p>
  
  <p>This is my first time using this site so let me know if I screwed up on anything for the future. And thanks for helping!</p>