Error with tkinter class : <p>I am making a basic temperture converter, I have it so you can convert celcius to farenheight, and now im trying to make it so you can switch. I have this code:</p>

<pre><code>from tkinter import *
bool1 = True
class App:
    def __init__(self, master):
        frame = Frame(master)
        frame.pack()
        self.x = Label(frame, text = 'Celcius:').grid(row = 0, column = 0)
        self.c_var = DoubleVar()
        Entry(frame, textvariable = self.c_var).grid(row = 0, column = 1)
        self.z = Label(frame, text = 'Farenheight:').grid(row = 1, column = 0)
        self.result_var = DoubleVar()
        Label(frame, textvariable = self.result_var).grid(row = 1, column = 1)
        b1 = Button(frame, text = 'Switch', command = self.switch)
        b1.grid(row = 2, columnspan = 2)
        button = Button(frame, text = 'Convert', command = self.convert)
        button.grid(row = 3, columnspan = 2)
        return None
    def convert(self):
        c = self.c_var.get()
        c = c * (9/5) + 32
        self.result_var.set(c)
    def switch(self):
        global bool1
        if bool1 == True:
            bool1 = False
            self.x.config(text = 'Farenheight:')
        else:
            bool1 = True
            self.z['text'] = 'Celcius:'
root = Tk()
root.wm_title('Temp Converter')
app = App(root)
root.mainloop()
</code></pre>

<p>The error message I am getting is:</p>

<pre><code>Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\keith\AppData\Local\Programs\Python\Python35-    32\lib\tkinter\__init__.py", line 1550, in __call__
    return self.func(*args)
  File "C:\Users\keith\Desktop\tkinter.py", line 26, in switch
    self.x.config(text = 'Farenheight:')
AttributeError: 'NoneType' object has no attribute 'config'
</code></pre>
