title: How do I check if input is a fraction (Python)?
body: <p>I have a bit of trouble with validation of user input. For this task, the user has to input a fraction in the form x/y (e.g. 3/5) and it is printed after the user types input. The problem here is that I do not know how to check if the user input is in the specified form. </p>
  
  <p>Wrong inputs should be something like this:</p>
  
  <pre><code>Input a fraction then press enter: 2/3/4
  That is not a valid fraction
  Input a fraction then press enter: 66
  That is not a valid fraction
  </code></pre>
  
  <p>My current code is</p>
  
  <pre><code>def main():
  while True:
      try:
          question = input("Input a fraction then press enter: ")
          break
      except:
          print("Please enter a valid fraction in the form x/y")
  print(question)
  </code></pre>
  
  <p>As you can see, I am stuck on how to validate the input. Can anyone help solve this issue</p>
  
  <p>Thanks in advance</p>