title: Creating A Class/Def For A If Else Statement Python
body: <p>so I'm making a simple python program to ask maths questions. It is currently fully working but I want to try and condense the code down. The user has an option of 6 menu items to pick from, each one of these is an Addition, Subtraction, Multiplication..... And each one of them has the following code at the end to check if the user wants to carry on or try a different menu item.</p>
  
  <pre><code>contC = input()
          if contC == "Y" or contC == "y":
              cont = True
  
          elif contC == "N" or contC =="n":
              cont = False
  </code></pre>
  
  <p>This code is being in every menu choice, I want to create one method to be able to use for all of them, a class or a def? I've tried different things but can't seem to get anything to work. </p>