title: Python code works in one .py file but not a new one
body: <p>I ran the following code in a .py file (generated by Sublime Text v3126) using Terminal in Ubuntu. Ctrl+B doesn't show any errors in Sublime Text but running in Terminal yields an error. Strangely, this code worked in Terminal when it was in a previous .py file, which had other codes. Anyway, here's the particular code:</p>
  
  <pre><code>import math
  import cmath
  import datetime
  import random as RAN
  from tabulate import tabulate
  
  def main():
      print ("")
      print("Key in a word.")
      while True:
          try:
              x = str(input())
              x = x.casefold()
              xr = reversed(x)
              print("")
              print("Using iterative and/or recursive functions...")
          except ValueError:
              print("Invalid input. Try again")
              print("")
              continue
          if (list(x) != list(xr)) or (x != x[::-1]):
              print("The input is not a palindrome. Try again.")
              print("")
              continue
          else:
              print("The input is a palindrome.")
              break
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>So, when I run this code in a .py file containing only this code, I get this error in Terminal:</p>
  
  <pre><code>Key in a word.
  example
  Traceback (most recent call last):
    File "./Test Pad.py", line 30 in &lt;module&gt;
      main()
    File "./Test Pad.py", line 12 in main
      x = str(input())
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  NameError: name 'example' is not defined 
  </code></pre>
  
  <p>Thank you for your consideration.   </p>