import tkinter
import random
# GUI
window = tkinter.Tk()
window.title("Hangman")
window.geometry("640x400+100+100")
frame = tkinter.Frame(window)
frame.pack()
button_animal = tkinter.Button(frame)
button_animal['text'] = "Animal"
button_animal['background'] = 'yellow'
button_animal.pack()
button_capital = tkinter.Button(frame)
button_capital['text'] = "Capital"
button_capital['background'] = 'blue'
button_capital.pack()
This is what I wrote so far, what am I supposed to do to make the button to make event happens?
if I click animal, it should play a game, but I am not sure how to do at first.
commandoption to execute a function when clicked.