title: how to assign a value during\after if
body: <p>Why can i not assign the value of ES? My values are .5, 13, and 2 although nothing comes from the 2 yet
  This is the error </p>
  
  <blockquote>
    <p>in 
        print ("Allowance ="), ES NameError: name 'ES' is not defined</p>
  </blockquote>
  
  <pre><code>import math
  
  D = input("Nominal Size: ")
  TPI = input("TPI: ")
  TOL = input("Tolerance Class 1, 2, 3: ")
  P = float(1.0/TPI)
  H = float((math.sqrt(3)/2)*P)
  D2 = float(D-2*.375*H)
  D1 = float(D-2*.625*H)
  
  
  if ((0.05*(pow(P,2)**(1/3))+(0.03*(P/D)))-0.002) &lt; (0.25*P)-(0.4*pow(P,2)):
      ES = float((0.25*P)-(0.4*pow(P,2)))
  
  print ""
  print ("Pitch ="), P
  print ("Fundamental Triangle Height ="), H
  print ("Allowance ="), ES
  print ("Basic Pitch Diameter ="), D2
  print ("Basic Minor Diameter ="), D1
  </code></pre>