title: Python guessing game (need help getting closest number)
body: <p>im trying to have 2 players, both guesses a number between 1-10. script generates a random number from 1-10 and both users guess and i need a algorithm that says which player was the closest to the guess</p>
  
  <pre><code>python
  import random
  
  x = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  w = random.choice(x)
  
  close = user - 1
  close2 = user + 2
  
  while 1:
      user = raw_input('bet: ')
  
      if user == w:
          print('you won')
          break
      else:
          print 'you lost'
  </code></pre>