title: How to fix SyntaxError: 'break' outside loop in Python app
body: <pre><code>def add(num1, num2):
      return num1 + num2
  
  def sub(num1, num2):
      return num1 - num2
  
  def mul(num1, num2):
      return num1 * num2
  
  def div(num1, num2):
      return num1 / num2
  
  print(f&quot;Select Operation&quot;)
  print(f&quot;1) Addition&quot;)
  print(f&quot;2) Subtraction&quot;)
  print(f&quot;3) Multiplication&quot;)
  print(f&quot;4) Divition&quot;)
  
  while True:
      choice = input(&quot;Enter choice (1, 2, 3, or 4): &quot;)
  
  if choice in ('1', '2', '3', '4'):
      num1 = float(input(&quot;Enter the first number: &quot;))
      num2 = float(input(&quot;Enter the second number: &quot;))
  
      if choice == '1':
          print(f&quot; {num1} + {num2} = &quot;, add(num1, num2))
      elif choice == '2':
          print(f&quot; {num1} - {num2} = &quot;, subtract(num1, num2))
      elif choice == '3':
          print(f&quot; {num1} * {num2} = &quot;, multiply(num1, num2))
      elif choice == '4':
          print(f&quot; {num1} / {num2} = &quot;, divide(num1, num2))
      
      next_calculation = input(&quot;Let's do another calculation? (yes/no): &quot;)
      if next_calculation == &quot;no&quot;:
          break
      
  else:
      print(&quot;Invalid Input&quot;)
  </code></pre>
  <p>I need help understanding why the <code>break</code> after <code>if next_calculation == &quot;no&quot;</code>: always spits out <code>SyntaxError: 'break' outside loop</code>. Please help me fix it so the simple app will run.</p>