title: AttributeError: 'float' object has no attribute 'upper'
body: <p>I wrote this code to use the Pythagorean theorem but I get the error shown below when I execute the code.</p>
  
  <p>Why am I getting an <code>AttributeError</code> here?</p>
  
  <pre><code>import math
  while True:
  
      missing_value_valid = False
      while missing_value_valid == False:
          try:
              missing_value_text = input('Please enter the missing side: ')
              missing_value_valid = True
          except ValueError:
              print ('Please enter a valid variable.')
  
          missing_value = missing_value_text
  
          if missing_value.upper() == 'C':
              print ('please enter the known lengths: ')
              adjacent_side = int(input('please enter the length of the adjacent side:'))
              opposite_side = int(input('please enter the length of the opposite side:'))
              hypotenuse = math.pow(adjacent_side,2) + math.pow(opposite_side,2)
              missing_value =  math.sqrt(abs(float(hypotenuse)))
              print('The answer is:', (float(missing_value)))
  
          if missing_value.upper() == 'B':
              print ('please enter the known lengths: ') 
              adjacent_side = int(input('Please enter the lenght of the adjacent side:'))
              hypotenuse = int(input('Please enter the lenght of the hypotenuse side:'))
              opposite_side = math.pow(adjacent_side,2) - math.pow(hypotenuse,2)
              missing_value =  math.sqrt(abs(float(opposite_side)))
              print('the answer is:', (float(missing_value)))
  
          if missing_value.upper() == 'A':
              print ('please enter the known lengths: ') 
              opposite_side = int(input('Please enter the lenght of the adjacent side: '))
              hypotenuse = int(input('Please enter the lenght of the hypotenuse side: '))
              adjacent_side = math.pow(opposite_side,2) - math.pow(hypotenuse,2)
              missing_value =  math.sqrt(abs(float(adjacent_side)))
              print('The answer is: ', (float(missing_value)))
  </code></pre>
  
  <p>Full error:</p>
  
  <pre><code>
  Exception has occurred: AttributeError
  'float' object has no attribute 'upper'
    File "C:\Users\kiran\Documents\python files\pythogerous theorem\pythegrous theorem.py", line 22, in &lt;module&gt;
      if missing_value.upper() == 'B':
  
  </code></pre>
  
  <p>I only get this error when I check the code for the value for C.</p>