title: I keep reveicing the error "NameError: name 'labelAns' is not defined",
body: <p>Basically all I have to do is change the text on <code>labelAns</code> to a value that I insert by pressing a button, but I keep receiving an error and I don't know how I could fix it.</p>
  
  <p>All I need to do now is change the label on command.</p>
  
  <pre><code>class PageOne(tk.Frame):
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          label = tk.Label(self, text="Differentiation Calculator", font=LARGE_FONT)
          label.pack(pady=10,padx=10)
  
          button1 = tk.Button(self, text="Main Menu",
                              command=lambda: controller.show_frame(StartPage))
          button1.pack()
  
          button2 = tk.Button(self, text="Integration",
                              command=lambda: controller.show_frame(PageTwo))
          button2.pack()
  
          self.num = tk.IntVar()
          self.entry = tk.Entry(self, textvariable=self.num)
          self.button = tk.Button(self, text='Differentiate', command=self.calc)
  
          labelAns = tk.Label(self,text = "0", width = 15)
          labelAns.pack(side = 'right')
  
  
          self.entry.pack(side = 'left')
          self.button.pack(side = 'left')
  
  
      def calc(self):
          Jack = (self.entry.get())
  
          x = sp.Symbol('x')
  
          res = (sp.diff(Jack,x))
  
          global labelAns
  
          labelAns(text = res)
  
  
          print(res)
  </code></pre>