title: Python Traceback (most recent call last)
body: <p><strong>Craps is a popular dice game played in casinos.</strong></p>
  <p><strong>Write a python program to play a variation of the game as follows:</strong>
  <em>Roll two dice. Each die has six faces representing values
  1, 2, 3, 4, 5, and 6. Check the sum of the two dice. If the sum is 2, 3, or 12 (called craps), you lose; if the sum is 7 or 11 (called natural), you win; if the sum is another value (i.e., 4, 5, 6, 8, 9, or 10), a point is established and you continue to roll the dice until either a 7 or the same point value is rolled. If 7 is rolled, you lose and if you roll the point value you win.</em></p>
  <pre><code>    import random
  
  def rollDice():
      dice1=random.randint(1,6)
      dice2=random.randint(1,6)
      return dice1, dice2
      
  def determine_win_or_lose(dice1,dice2):
      dice1=random.randint(1,6)
      dice2=random.randint(1,6)
      sum=dice1+dice2
      print(&quot;You rolled %d + %d = %d&quot;%(dice1,dice2,sum))
      if sum==2 or sum==3 or sum==12: 
          lose=lose+1 
      elif sum==7 or sum==11: 
          win=win+1 
      else:
          print(&quot;point is %d&quot;%(sum))
          determinePointValueResult()
          p=sum 
          print(&quot;You rolled&quot;,dice1,&quot;+&quot;,dice2,&quot;=&quot;,sum) 
          p1=p 
          if sum==p: 
              win=win+1 
              print(&quot;You Win&quot;) 
              print(&quot;\n\n&quot;) 
          else: 
              lose=lose+1 
              print(&quot;You lose&quot;) 
              print(&quot;\n\n&quot;) 
      return sum
      
  def determinePointValueResult(point):
      while sum!=7 and sum!=point:
          rollDice()
          dice1=random.randint(1,6) 
          dice2=random.randint(1,6) 
          sum=dice1+dice2
          if sum == point:
              win=win+1
              break
          elif sum == 7:
              lose=lose+1
              break
          print(&quot;You rolled&quot;,dice1,&quot;+&quot;,dice2,&quot;=&quot;,sum)
      return sum
     
  if __name__ == &quot;__main__&quot;:
      
      win=0
      lose=0
      nmbr=input(&quot;How many games do you want to play &gt; &quot;)
      for I in number:
          rollDice()
          determine_win_or_lose(win,lose)
          if win:
              win=win+1
              print('You win')
              break
          else:
              lose=lose+1
              print('You lose')
              break
      print(win,&quot;Wins and&quot;,lose,&quot;losses&quot;)```
  </code></pre>