It is very difficult to understand how the expected output is connected to the input. Can you explain this ? Also why did you post this in four different forums (python, java, C, C++)? What do you want exactly ?
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: