title: If user input is not part of string values asked, default output
body: <p>Here is a code I made a while ago, I want to make it so that by default it calls the add function, so if I just input enter (or anything) it will ask me what two numbers I wish to add.
  I have tried putting,</p>
  <pre><code>else:
  num1 = float(input(&quot;Enter First Number: &quot;))
  num2 = float(input(&quot;Enter Second Number: &quot;))
  print(num1, &quot;+&quot;, num2, &quot;=&quot;, add(num1, num2))
  </code></pre>
  <p>but that is not working, any help would be greatly appreciated! Here is the entire code below</p>
  <pre><code>import math as m
  def add(x, y):
      return x + y
  
  def subtract(x, y):
      return x - y
  
  def multiply(x, y):
      return x * y
  
  def divide(x, y):
      return x / y
  
  def power(x, y):
      return x ** y
  
  def nroot(x, y):
      return x ** (1/y)
  
  def sin(D):
      R = D / 180 * m.pi
      return(m.sin(R))
  def cos(D):
      R = D / 180 * m.pi
      return(m.cos(R))
  
  print(&quot;Select Operation.&quot;)
  print(&quot;1. Add&quot;)
  print(&quot;2. Subtract&quot;)
  print(&quot;3. Multiply&quot;)
  print(&quot;4. Divide&quot;)
  print(&quot;5. Exponent&quot;)
  print(&quot;6. sin(Degrees)&quot;)
  print(&quot;7. cos(Degrees)&quot;)
  
  while True:
      # Take input from user
      choice = input(&quot;Enter Choice[1-7]: &quot;)
  
      #check if choice is one of the four
      if choice in ('1', '2', '3', '4', '5'):
          num1 = float(input(&quot;Enter First Number: &quot;))
          num2 = float(input(&quot;Enter Second Number: &quot;))
  
      if choice == '1':
          print(num1, &quot;+&quot;, num2, &quot;=&quot;, add(num1, num2))
      elif choice == '2':
          print(num1, &quot;-&quot;, num2, &quot;=&quot;, subtract(num1, num2))
      elif choice == '3':
          print(num1, &quot;*&quot;, num2, &quot;=&quot;, multiply(num1, num2))
      elif choice == '4':
          print(num1, &quot;/&quot;, num2, &quot;=&quot;, divide(num1, num2))
      elif choice == '5':
          print(num1, &quot;^&quot;, num2, &quot;=&quot;, power(num1, num2))
  
      if choice in('6','7'):
          angle = float(input('Enter Angle in degrees: '))
  
      if choice =='6':
          print('sin(',angle,') = ',sin(angle))
      elif choice =='7':
          print('cos(',angle,') = ',cos(angle))
    
      break
  </code></pre>