title: How to stop exit code one from popping up in my console?
body: <p>I am trying to make a simple calculator in python. The whole idea is that I can integrate multiple types of calculators inside one big one. Right now I am trying to put both geometry and basic numbers into my calculators. Here is the code:</p>
  <pre><code>    #varibles
  question = input(&quot;do you want shapes or numbers: &quot;)
  
  if question == &quot;shapes&quot;:
      geometry = input(&quot;This is for shapes. Enter which shape: triangle and rectangle: &quot;)
  
      # normal
      if geometry == &quot;triangle&quot;:
          base = int(input(&quot;Enter the base: &quot;))
          height = int(input(&quot;Enter the height: &quot;))
          print((base * height) / 2)
      elif geometry == &quot;rectangle&quot;:
          number1 = int(input(&quot;Enter length: &quot;))
          number2 = int(input(&quot;Enter width: &quot;))
          print(number1 * number2)
  
      else:
          print(&quot;invalid operation. please restart the program and try again&quot;)
  
  if question == &quot;numbers&quot;:
      operation = input(&quot;Enter the operation. * for multiply. / for divide. + for add. - for subtract. ^ for power of: &quot;)
      number1: int = int(input(&quot;Enter the first number: &quot;))
      number2 = int(input(&quot;Enter the second number: &quot;))
  
  #normal
  if operation == &quot;+&quot;:
      # print(int(number1) * int(number2))
      print(number1 + number2)
  if operation == &quot;-&quot;:
      print(number1 - number2)
  elif operation == &quot;*&quot;:
      print(number1 * number2)
  elif operation == &quot;/&quot;:
      print(number1 / number2)
  elif operation == &quot;^&quot;:
      print(pow (number1,number2))
  else:
      print(&quot;invalid operation. please restart the program and try again&quot;)
  
  #triangle
  </code></pre>
  <p>Whenever I run the program, it gives me this error message.</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:/Users/rohit/PycharmProjects/untitled2/attempt 1.py&quot;, line 26, in &lt;module&gt;
      if operation == &quot;+&quot;:
  NameError: name 'operation' is not defined
  
  Process finished with exit code 1
  </code></pre>
  <p>How can I fix my code so I don't get this error message?</p>