This is my code, I am trying to make it so that when I press a button, a specific text shows up
from tkinter import *
def greet():
label.config(text = "Hi there!")
root = Tk()
root.title("Placing a button")
button = Button(root, text = "Click here", command = greet).pack()
label = Label(root, text = " n ").pack()
root.mainloop()
However, when I run it and click the button, I get this error:
label.config(text = "Hi there!")
AttributeError: 'NoneType' object has no attribute 'config'
I would really appreciate help.