title: python - how would I put an if else statement in a function for abstraction?
body: <p>I am making a Dichotomous Key program where it asks questions to determine the name of the creature that is in question. Here is how it looks like right now:</p>
  
  <pre><code>step = 0
  yes = ["y", "yes"]
  no = ["n", "no"]
  while step == 0:
      q1 = input("Are the wings covered by an exoskeleton? (Y/N) ")
      q1 = q1.lower()
      if q1 in yes:
          step += 1
      elif q1 in no:
          step += 2
      else:
          print("Huh?")
  </code></pre>
  
  <p>How would I put the if and else statement into a function so that I can reuse it for every question asked and change the step variable?</p>
  
  <p>-Thanks</p>