title: Python code works when calling a method but not when running a programm
body: <p>I wanted to make my own python program for converting degrees Fahrenheit or Celsius to another unit. I'm a python newbie. This is my code</p>
  
  <pre><code>def f_to_c(temp):
          return (temp - 32) * 5 / 9
  def c_to_f(temp):
          return temp * 9 / 5 + 32
  def execute():
          what = input("Unit you want to convert? (f/c) ")
          while (what == "c" or what == "C" or what == "f" or what == "F"):
              if what == "c" or what == "C":
                  temp = float(input("Enter degrees Celsius: "))
                  return c_to_f(temp)
              else:
                  temp = float(input("Enter degrees Fahrenheit: "))
                  return f_to_c(temp)
          else:
              return execute()
  </code></pre>
  
  <p>This part of the code works after executing in IDLE and running execute() method. But if I add:</p>
  
  <pre><code>execute()
  </code></pre>
  
  <p>to the end of my .py file, there is an error. It gets to the second question (degrees Fahrenheit or Celsius). It just breaks. Is there a way to fix it?</p>
  
  <p>Thanks in advance.</p>