title: Error handling assistance requested in Python temperature converter
body: <p>I'm a programming student working on a Python assignment to design an application that can convert Celsius to Fahrenheit or the other way around. My current code is working when it gets the expected values but running into some problems when the input doesn't meet the expected format:</p>
  <pre><code>temp = &quot;&quot; #set initial value for temp variable
  celsfahr = &quot;&quot; #set initial value for Celsius or Fahrenheit
   
  while temp != &quot;exit&quot;:
      temp, celsfahr = input(&quot;Enter a temperature in Celsius or Fahrenheit (examples: 32 Celsius, 500 Fahrenheit, -10 Celsius:) &quot;).split()
      if temp.isnumeric():
          temp = int(temp)
          if celsfahr == &quot;Fahrenheit&quot;:
              print(temp, &quot;Fahrenheit equals&quot;, ((temp-32)*.556), &quot;Celsius.&quot;)
          else:
              if celsfahr == &quot;Celsius&quot;:
                  print(temp, &quot;Celsius equals&quot;, ((temp*1.8)+32), &quot;Fahrenheit.&quot;)
      else:
          if temp.lower() == &quot;exit&quot;:
              temp = temp.lower()
              print(&quot;Goodbye.&quot;)
          else:
              print(&quot;I don't understand. Try again.\n&quot;)
  </code></pre>
  <p>A few problems I'm trying to solve:</p>
  <ol>
  <li>How to add a check in the input/split so that the program doesn't crash if anything other than two space-separated values are entered</li>
  <li>Related, how to accept &quot;exit&quot; as a value in the input field with the split in place</li>
  <li>How to trigger the &quot;I don't understand&quot; error message earlier -- right now unexpected values other than Celsius or Fahrenheit return the program to the input but don't show an error</li>
  </ol>