title: NameError: name 'root' is not defined in python 3
body: <p>Below is the program I am trying to run</p>
  
  <pre><code>from tkinter import *
  import tkinter as tk
  from tkinter.ttk import *
  from tkinter import LabelFrame, Label, Tk#, Canvas
  from tkinter.ttk import Notebook
  import tkinter.messagebox
  import time
  import os
  
  
  import warnings
  warnings.filterwarnings('ignore')
  
  class GUIDesign():
      def __init__(self,root):
          self.initUI(root) 
  
      def initUI(self,root):
          print ("hello")
  
      LabelFrameFG="purple"
      LabelFrameBG="SNOW"
  
      note = Notebook(root)
      tab1 = Frame(note)
      tab6 = Frame(note)
  
  def main():
      root = Tk()
      root.resizable(0,0)
      root.state('zoomed')
      GUI=GUIDesign(root)
      root.mainloop()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>it gives error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "E:\Python\tk.py", line 16, in &lt;module&gt;
  class GUIDesign():
  File "E:\Python\tk.py", line 35, in GUIDesign
  note = Notebook(root)
  NameError: name 'root' is not defined
  </code></pre>
  
  <p>The problem is in importing Notebook? or the class and its function? or python's version problem? Can anybody tell me what is wrong with this program please? </p>