I am sorry but i wasnt very clear in my initial post. :icon_redface:
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: