title: Checking an input in python
body: <p>Basically, I'm asking for an input, which is going to be <code>split(',')</code> however, if the person doesn't input it properly, for example they accidentally input just <code>5,</code> or don't include a comma at all, it comes up with an error that something is undefined.</p>
  
  <p>Does anyone have any idea of how to check that the input is in the right sort of format?</p>
  
  <p>Edit: Here's the code in question...it's to do with coordinates</p>
  
  <pre><code>def EnterCoords():
      coordinates = input("Enter coordinates in the following format x,y").split(',')
      x, y = Coordinates[0], Coordinates[1]
  </code></pre>
  
  <p>I then use the x and y values in a calculation elsewhere, which brings up the error <code>IndexError: list index out of range</code> So, if the user enters them wrong, is there a way of calling the function again, for them to try again</p>