Tkinter - Python, how do I cause a button click to assign a value to a variable?

Using Tkinter and Python. Already created a window for the buttons to be placed on. I want there to be four buttons to appear, and I want to be able to click one of the four buttons, and be able for it to set the selection variable = "whatever I clicked", so that I can then use this variable later to call an API. When I run the program and click on the "General knowledge" button and print the selection, it does correctly print "General knowledge", but then when I try to return this selection variable it just doesn't work and I don't know why.

def select1():
    selection = "General Knowledge"

def select2():
    selection = "Science"

def select3():
    selection = "Entertainment"

def select4():
    selection = "Miscellaneous"

button1 = tk.Button(text = "General Knowledge", command = select1)
button1.place(x=100, y=100)

button2 = tk.Button(text = "Science", command = select2)    
button2.place(x=100, y=140)

button3 = tk.Button(text = "Entertainment", command = select3)
button3.place(x=100, y=180)

button4 = tk.Button(text = "Miscellaneous", command = select4)
button4.place(x=100, y=220)

Python 21-10-22, 5:53 p.m. likithsai
I will follow your blogs and share them with everyone since this is a fantastic source of knowledge. I think highly of the author of this piece; you are quite skilled. I hope you will spread the word about them and find more success. fnf
24-10-22, 10 a.m. leemarryu

Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! terra hill
14-12-22, 12:29 p.m. xacax48443

Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! how much is yours worth?
15-12-22, 11:57 a.m. xacax48443

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. instagram reseller
26-12-22, 3:03 p.m. xacax48443

I love the way you write and share your niche! Very interesting and different! Keep it coming! pg slot play test
14-01-23, 7:42 p.m. xacax48443

This author educates that the three main schools of management thought are: the classical; the human-behavioural; and the integrative. MBA in sports management in India
09-02-23, 2:42 p.m. sepiva6103

Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks sports
12-02-23, 9:23 p.m. sepiva6103

This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!. pencil packing work from home
23-02-23, 1:26 p.m. kacir28394

Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. pencil packing job
23-05-23, 2:21 p.m. kacir28394

Log-in to answer to this question.