title: How do I make a variable from another function work on another Python?
body: <p>So here is my entire code, I am having trouble when it says height is not defined in <code>window_Calculate()</code>. My aim is to use the formula <code>50 + (height * width) * 100</code>. In <code>window_Size</code>, the user must input a <code>height</code> and <code>width</code> but if they type anything that is not a number, it is supposed to return it so they can enter in an actual number. Overall, <code>height</code> is not defined while in a different function and does not return back to the input if user enters anything but numbers. How can I make <code>height</code> defined and return back to the input? </p>
  
  <pre><code>import time 
  
  def Intro():
      print("Welcome to Wendy's Windows.")
      time.sleep(2)
      print("This is a window replacement business.")
      time.sleep(2)
      print("Enter your size in the box on the left and the price will be displayed below.")
      time.sleep(2.5)
  
  def window_Size():
      print("Put height first then put width.")
      time.sleep(1.5)
      height = input("Height: ")
      try:
          int(height)
      except ValueError:
           try:
              float(height)
           except ValueError:
              print("Enter only numbers.")
              return(height)
      else:
          print(height + "m")
      width = input("Width: ")
      try:
          int(width)
      except ValueError:
          try:
              float(width)
          except ValueError:
                  print("Enter only numbers.")
                  return(width)
      else:
          print(width + "m")
  
  def window_Calculate():
      window_Calculate = '50' + (height * width) * '100'
  
  def window_Cost():
      print("Your price is" + window_Calculate + "$")
  
  window_Size()
  window_Calculate()
  window_Cost()
  </code></pre>