For some bizarre reason teachers use a syllabus based on very traditional programming that insist on torturing students with naked arrays before letting them use any more useful collection classes. IMHO that's a distraction because they spend more time struggling with uninitialised array elements, trying to guess a size for the array, etc rather than thinking about algorithms and code structure.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: