title: How to reuse user's raw input in other function
body: <p>I m making a 2D board game for python for hw. </p>
  
  <p>I asked user to input a integer for the board size. for example, 7. I have modified a bit (only show the important ones) before posting. the function is like follows</p>
  
  <pre><code>def asksize():           
      while True:
          ask=raw_input("Input board size: ")  
          try:
              size=int(ask)
              return size
  
          except ValueError: 
              print "Please enter a integer"   
  </code></pre>
  
  <p>Because it is variable board size, I need reuse the variable size in other function, use it for checking user's move is valid or not, how can I reuse the variable?</p>
  
  <pre><code>def checkmove(move):    
      #move is sth like eg. A1:B2
      move=move.split(":") #I split it so it becomes ['A','1']['B','2']  
      if size&gt;=int(move[0][1]) and int(move[0][1])&gt;=1 and size&gt;=int(move[1][1]) and int(move[1][1])&gt;=1: #for example if board size is 7, this is to check whether user input is between 1 to 7 within the board
          return True
      else:
          return False 
  </code></pre>
  
  <p>In my checkmove function, I can't use size in my argument because it is not defined, how can I make it workable?</p>
  
  <p>Thanks</p>